Support

Account

Home Forums Add-ons Repeater Field Troubles with true/false in repeater Reply To: Troubles with true/false in repeater

  • could you try this (use have_rows and a wile loop instead of your foreach loop) :

    <aside class="widget">
    <?php
    if( have_rows('tool_section_links') ):
    echo '<h2>Tools</h2>';
    echo '<ul>';
    while( have_rows('tool_section_links') ): the_row();
    
    $show_desktop = get_sub_field('show_desktop');
    $tool_link = get_sub_field('tool_link');
    $tool_link_title = get_sub_field('tool_link_title');
    if ($show_desktop == 'yes'){
    echo '<li class="show-for-large-up"><a href="'.$tool_link.'">'.$tool_link_title.'</a></li>';
    } else {
    echo '<li><a href="'.$tool_link.'">'.$tool_link_title.'</a></li>';
    }
    endwhile;
    echo '</ul>';
    endif;
    ?>
    </aside>

    depend on witch fieldtype you use change if ($show_desktop == 'yes') to correct value