I have a repeater row setup with “if” logic that shows extra html if get_sub_field exists. The issue is that if a certain row has the if logic, the next entry that precedes it also contains that if logic, ex:
<?php while( have_rows('resources') ): the_row(); // vars $embed_code = get_sub_field('embed_code');
<?php if( $embed_code ): ?> SOME HTMLE <?php endif; ?>
This same logic is applied to the next entry that precedes it. That next entry doesn’t have that conditional sub field associated. Hope this makes sense. Can someone please help. Not sure if this started to happen after the latest update to ACF.
Thanks for replying James. Sorry it took so long for me to view this. Here is what is happening:
Using Developer Tools, here is what is showing in the rendered HTML for a resource whose type is NOT equal to video:
You must be logged in to reply to this topic.
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!
© 2023 Advanced Custom Fields.