Skip to content

Instantly share code, notes, and snippets.

@besimhu
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save besimhu/13156e2f506dc9ef19ea to your computer and use it in GitHub Desktop.
Save besimhu/13156e2f506dc9ef19ea to your computer and use it in GitHub Desktop.
Loop sample for pulling in ACF Flex-Content modules.
<?php
/**
* Flex Content Loop for Modules
*/
if (have_rows('layout_modules')):
while (have_rows('layout_modules')):
the_row();
switch (get_row_layout()) {
// Sample Module
case 'mod_sample':
include(get_template_directory() . '/partials/modules/sample-module.php');
break;
// Sample Module Two
case 'mod_sample_module_two':
include(get_template_directory() . '/partials/modules/sample-module-two.php');
break;
}
endwhile;
endif;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment