Home › Forums › Add-ons › Flexible Content Field › Reorder Flexible Content Rows in another page › Reply To: Reorder Flexible Content Rows in another page
The simplest way to do this would be to add the same field group to the admin of this other page and enter the content there.
Alternately, you could store the first row in an object buffer and then output in after the second one, however, what will you do if the order is changed on the other page?
<?php
$buffer = '';
if( have_rows('contact', $page_id) ): while ( have_rows('contact', $page_id) ) : the_row(); ?>
<?php if( get_row_layout() == 'email' ): ?>
<?php ob_start(); ?>
<a href="mailto:<?php the_sub_field('email'); ?>"><?php the_sub_field('email'); ?></a>
<?php $buffer = ob_get_clean(); ?>
<?php elseif ( get_row_layout() == 'text' ): ?>
<span class="aadress"><?php the_sub_field('text'); ?></span>
<?php
if ($buffer) {
echo $buffer;
$buffer = '';
}
?>
<?php endif; ?>
<?php endwhile; endif; ?>
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.