Flexible Content Dynamic Render confusion
-
Hi there,
This is a great plugin!
I am following this documentation (https://www.acf-extended.com/features/fields/flexible-content/dynamic-render), but I am kind of confused regarding the Front-End Render the_flexible(), has_flexible() & get_flexible() functions.
How do I switch from my current code to using these new functions?I am currently using this code (see below):
if( have_rows('sp_modules') ): // loop through the rows of data while ( have_rows('sp_modules') ) : the_row(); if( get_row_layout() == 'text_block' ): get_template_part( 'modules/module', 'text-block' ); elseif( get_row_layout() == 'split_image_block' ): get_template_part( 'modules/module', 'split-image-block' ); elseif( get_row_layout() == 'column_cards' ): get_template_part( 'modules/module', 'column-cards' ); endif; endwhile; else : // no layouts found endif;
‘sp_modules’ is the flexible content field name, and all the template files are in the ‘modules’ folder.
How do I replace my current code with the new functions the_flexible(), has_flexible() & get_flexible()?
Thanks!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Flexible Content Dynamic Render confusion’ is closed to new replies.