Home › Forums › Add-ons › Repeater Field › Get only the matching subfield value within the repeater element inside a code b › Reply To: Get only the matching subfield value within the repeater element inside a code b
Only if you can pass that value to the PHP code. I don’t know anything about the builder you’re using so I can’t answer that.
Normally in php I would do something like this to only show a specific row.
<?php if( have_rows('veranstaltung_treffpunkt') ): ?>
<?php while( have_rows('veranstaltung_treffpunkt') ): the_row(); ?>
<?php
if (get_sub_field('some-field') == $passed_value)) {
// vars
$value = get_sub_field('what3words');
$str2 = ltrim($value, '/');
}
?>
<a>">/// <?php echo $str2; ?></a>
<?php endwhile; reset_rows(); ?>
<?php 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.