Home › Forums › Add-ons › Flexible Content Field › Get another page's Flexible Content › Reply To: Get another page's Flexible Content
if(have_rows('page_builder', $this_page)):
while(have_rows('page_builder', $this_page)): the_row();
if( get_row_layout() == 'page_content_block' ):
$this_text = get_sub_field('page_content_editor');
$this_text_plain = strip_tags($this_text);
// flexible row logic
endif;
endwhile;
endif;
I found that if you try and pass get_sub_field('repeater_page_object')->ID
as the have_rows() $id parameter, it will cause an infinite loop, however, if you store these values as a variable on each loop index it works fine.
The above is an example of how I managed to get the result I wanted. This was placed within a flexible content loop in a if (get_row_layout == 'x') { }
statement.
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.