Created
April 20, 2023 19:05
-
-
Save KreigD/5f260ed800c7917ed225753a5ea2894e to your computer and use it in GitHub Desktop.
Revisions
-
KreigD created this gist
Apr 20, 2023 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ <?php /** * Partial template for ACF flexible content * * @package Understrap */ // Exit if accessed directly. defined( 'ABSPATH' ) || exit; the_title( '<h1 class="entry-title d-none">', '</h1>' ); // check for ACF flexible content data if ( have_rows( 'modules' ) ) { // loop through the select ACF flexible content layouts while( have_rows( 'modules' ) ) { the_row(); // dispaly the matching flexible content partial get_template_part( 'modules/' . get_row_layout() ); // Just add your row templates into a directory named `modules` in the root of your theme // Each row template shoud have a filename matching the ACF slug // (ex: three-columns.php for a field with slug `three-columns`) } } This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,47 @@ <?php /** * Template Name: Flexible Content * * Template for displaying ACF Flexible Content Modules * * @package Understrap */ // Exit if accessed directly. defined( 'ABSPATH' ) || exit; get_header(); ?> <div class="wrapper" id="page-wrapper"> <div class="container-fluid" id="content" tabindex="-1"> <div class="row"> <main class="site-main" id="main"> <?php while ( have_posts() ) { the_post(); // Get the template part for looping through our flexible content fields get_template_part( 'loop-templates/content', 'flexible' ); // If comments are open or we have at least one comment, load up the comment template. if ( comments_open() || get_comments_number() ) { comments_template(); } } ?> </main><!-- #main --> </div><!-- .row --> </div><!-- #content --> </div><!-- #page-wrapper --> <?php get_footer();