Home › Forums › Add-ons › Repeater Field › True / False question › Reply To: True / False question
I am close to a solution, I have the true/false working but need the else piece of the puzzle to post to page id 235. any idea?
<?php if( have_rows('active_studies', 14) ): ?>
<?php while ( have_rows('active_studies', 14) ) : the_row(); ?>
<?php
// check if box is ticked
if( get_sub_field('complete_study') )
{
echo '<h1>'.the_sub_field('title').'</h1>',
'<h2>'.the_sub_field('investigator_name').'</h2>',
'<h2><i>'.the_sub_field('organization(s)').'</i></h2>',
'<p>'.the_sub_field('summary').'</p>',
'<h3>'.the_sub_field('related_content_title').'</h3>',
'<p style="color: #666666;">'.the_sub_field('related_content').'</p>';
}
else
{
echo "do something else";
}
?>
<?php endwhile;
else :
// no rows found
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.