Home › Forums › Add-ons › Options Page › Select specific repeater rows from an options page › Reply To: Select specific repeater rows from an options page
Sorry for bringing this post back again, I am trying this solution, but
if( in_array( $title == $selection ) ) {
Seems to lose my repeater. If I remove it all the repeater rows will show.
The code I am using is below, any feedback on where I’ve gone wrong would be a huge help to me.
<?php
$selection = get_field('author_select');
if( !empty( $selection ) ) {
if( have_rows( 'user_profile', 'option' ) ) {
while( have_rows( 'user_profile', 'option' ) ) {
the_row();
$title = get_sub_field('full_name');
if( in_array( $title == $selection ) ) {
$title = get_sub_field('full_name');
$org = get_sub_field('organization');
$img = get_sub_field('profile_image');
?>
<figure id="author">
<div class="d-grid">
<div class="left-contents">
<h4>ABOUT THE AUTHOR:</h4>
<div id="author-avatar"><img src="<?php echo $img; ?>" alt="<?php echo $title; ?>" /></div>
</div>
<div class="mid-contents">
<h5><?php echo $title; ?> | <?php echo $org; ?></h5>
</div>
</div>
</figure>
<?php
}
}
}
}
?>
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.