Home › Forums › General Issues › WP-PageNavi
Hi,
is there a chance to get WP-PageNavi working with ACF and the repeater field? WP-PageNavi works fine on “normal” pages and posts, but all attemps to get it work with the repeater field (and normal WYSIWYG fields) failed. 🙁
Greetings,
Svenni
Hi @Svenni
Thanks for the bug report.
I am yet to use this plugin, but will take a look in the future.
Can you provide details on what the current bug is?
Hi Elliot,
at the moment I don’t know if it’s a real bug or a bug in programming, so an example with WP-PageNavi installed and integrated in page template:
sample text:
site 1
<!--nextpage-->
site 2
<!--nextpage-->
site 3
sample text after clicking html button:
<p>site 1</p>
<p><!--nextpage--></p>
<p>site 2</p>
<p><!--nextpage--></p>
<p>site 2</p>
correct result in frontend if you put it in wp standard content field:
site 1
Pages: 1 2 3
result in frontend if you put it eg. in ACF WYSIWYG field:
site 1
site 2
site 3
I use normal code in template to output acf field like this:
<?php the_field("pagenavi-site");?>
Grettings,
Svenni
Hi @Svenni
Thanks for the debugging info.
I think the wp-pagenavi plugin is hooking into the the_content filter and modifying the value based on the comments.
In fact, I’m 99% sure it is.
All you need to do is run the the_content filter on the ACF value, and your output will render correctly!
echo apply_filters('the_content', get_field("pagenavi-site"));
Hi Elliot,
no, this don’t work. I tested it in a lot of versions the last days and now again – with the same result:
site 1
site 2
site 3
🙁
Greetings,
Svenni
Hi @Svenni
Are you sue WP Page navi has a shortcode for this?
I just looked at the installation guide, and can’t see any shortcode functionality.
I also searched the source code and found no reference to the_content, !–, or shortcode.
Are you assuming this functionality exists?
Hi elliot,
I don’t think that it is working with a shortcode. For making a page break you must use
<!--nextpage-->
which is’nt a shortcode, or I’m wrong with it? It’s like the standard
<!--more-->
of WordPress. This isn’t working, too, how I tested after writing about
<!--more-->
.
Greetings,
Svenni
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.