<?phpif(get_sub_field('cta')):$args=array('post_type'=>'ctas','p'=>get_sub_field('cta'),);$cta=newWP_Query($args);if($cta->have_posts()):while($cta->have_posts()):$cta->the_post();// check if the flexible layouts field has rows of dataif(have_rows('flexible_layouts')):// loop through the rows of layoutswhile(have_rows('flexible_layouts')):the_row();get_template_part('partials/flexible-layouts/'.get_row_layout());endwhile;else:// no layouts foundendif;endwhile;wp_reset_postdata();// IMPORTANTendif;endif;
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.