ACF Post Object within Flexible Content

<?php while(has_sub_field("section_selector")): ?> <?php if(get_row_layout() == "select_elementor_section"):?> <?php $sectionId = get_sub_field('choose_section'); echo do_shortcode('[elementor-template id="'.$sectionId.'"]'); ?> <?php echo($sectionId);?> <?php elseif(get_row_layout() == "comics"):?> <div>Hello Comics</div> <?php elseif(get_row_layout() == "magazines"):?> <div>Hello Magazines</div> <?php elseif(get_row_layout() == "toys"):?> <div>Hello Toys</div> <?php endif; ?> <?php endwhile; ?>

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.