Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mishterk/23a6e3f5a38f798002eb8e2c203f556a to your computer and use it in GitHub Desktop.
Save mishterk/23a6e3f5a38f798002eb8e2c203f556a to your computer and use it in GitHub Desktop.
Split an ACF flexible content field into template parts
<?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