Home › Forums › Add-ons › Flexible Content Field › Pagination › Reply To: Pagination
I think I’m trying to accomplish the exact same thing as @pixaro, but I’ve been spinning my wheels for hours and getting nowhere.
To be clear, I’m trying to split each flexible content section into its own page, as if I were using <!--nextpage-->
in the content.
Here’s a screenshot of my relevant layouts. You can see I’m attempting to use a layout called “Page Break” containing a true/false field called “Break Here” to create the breaks.
Here’s the simple, working loop I’m using to get the “Section Title” and “Section Text” into the page.
<?php while(has_sub_field("content")): ?>
<?php if(get_row_layout() == "section_content"): ?>
<h2><?php the_sub_field("section_title"); ?></h2>
<?php the_sub_field("section_text"); ?>
<?php endif; ?>
<?php endwhile; ?>
Beyond this, I’m lost. I’ve tried a number of things, including creating a counter using this information, but I could never get it to work.
Could anyone possibly share a more complete solution?
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.