Forked from mishterk/load-flexi-field-layout-partials-in-templates.php
Created
June 3, 2022 20:33
-
-
Save schutzsmith/005da56edd576b3a5075cc02e33944e1 to your computer and use it in GitHub Desktop.
Split an ACF flexible content field into template parts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// In a post/page template, loop over the ACF flexible field layouts and load the partial | |
// responsible for rendering the layout. | |
while ( the_flexible_field('my_flexi_field') ) { | |
get_template_part( 'components/'. get_row_layout() ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment