Skip to content

Instantly share code, notes, and snippets.

@joetower
Last active October 14, 2016 16:01
Show Gist options
  • Save joetower/17f46113794e5ceb2a6301612eebe408 to your computer and use it in GitHub Desktop.
Save joetower/17f46113794e5ceb2a6301612eebe408 to your computer and use it in GitHub Desktop.
WordPress flexible template page template example.
<?php
/**
* Template Name: Flexible Page Template
* // This template uses ACF and full-width featured image
*/
get_header(); ?>
<div id="primary" class="content-area">
<?php get_sidebar( 'content-top' ); ?>
<main id="main" class="site-main" role="main">
<?php
// Start the loop.
while ( have_posts() ) : the_post();
// Include the page content template.
get_template_part( 'template-parts/content', 'page-full' );
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) {
comments_template();
}
// End of the loop.
endwhile;
?>
</main><!-- .site-main -->
<?php get_sidebar( 'content-bottom' ); ?>
</div><!-- .content-area -->
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment