Support

Account

Home Forums Add-ons Repeater Field Loop Repeater Based on Sub Field Values Reply To: Loop Repeater Based on Sub Field Values

  • Hi @tomwgf

    Sorry about that. I forgot to remove the php tag. It should be working with this one:

    // PackageList shortcode
    function treatmentlistf($atts, $content = null) {
        $returned = "";
        if(have_rows('package_name', 'option')):
           while(have_rows('package_name', 'option')): the_row();
              if(get_sub_field('package_group') == 'caci_facials'):
                 $returned .= "<h2>Test Hello</h2>";
              endif;
           endwhile;
        endif;
        return $returned;
    }
    add_shortcode('treatmentlist', 'treatmentlistf');

    I hope this helps.