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!
The ACF site is currently experiencing some issues.— Advanced Custom Fields (@wp_acf) September 21, 2022
We apologize for the inconvenience and we are working hard to get it back up and running as soon as possible.
© 2022 Advanced Custom Fields.