Skip to content

Commit

Permalink
Adding new "blank" page template without a header or a footer
Browse files Browse the repository at this point in the history
  • Loading branch information
kimcoleman committed Oct 15, 2018
1 parent 8a5277b commit 4cb42c1
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 4 deletions.
8 changes: 5 additions & 3 deletions footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
* @package Memberlite
*/
?>
<?php if ( ! is_page_template( 'templates/fluid-width.php' ) && ! is_404() ) { ?>

<?php if ( ! is_page_template( 'templates/fluid-width.php' ) && ! is_page_template( 'templates/blank.php' ) && ! is_404() ) { ?>
</div><!-- .row -->
<?php } ?>

Expand All @@ -17,7 +18,7 @@

<?php do_action( 'memberlite_before_footer' ); ?>

<?php if ( ! is_page_template( 'templates/interstitial.php' ) ) { ?>
<?php if ( ! is_page_template( 'templates/interstitial.php' ) && ! is_page_template( 'templates/blank.php' ) ) { ?>
<footer id="colophon" class="site-footer" role="contentinfo">

<?php get_template_part( 'components/footer/footer', 'widgets' ); ?>
Expand Down Expand Up @@ -45,12 +46,13 @@
<?php get_template_part( 'components/footer/site', 'info' ); ?>

</footer><!-- #colophon -->
<?php } ?>
<?php } // End if(). ?>

<?php do_action( 'memberlite_after_footer' ); ?>

</div><!-- #page -->


<?php do_action( 'memberlite_after_page' ); ?>

<?php wp_footer(); ?>
Expand Down
7 changes: 6 additions & 1 deletion header.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
<?php do_action( 'memberlite_before_page' ); ?>
<div id="page" class="hfeed site">

<?php
// Hide header output for the Blank page template.
if ( ! is_page_template( 'templates/blank.php' ) ) { ?>

<?php get_template_part( 'components/header/mobile', 'menu' ); ?>

<a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'memberlite' ); ?></a>
Expand Down Expand Up @@ -97,13 +101,14 @@
?>
</nav><!-- #site-navigation -->
<?php } ?>
<?php } // End if(). ?>

<?php do_action( 'memberlite_before_content' ); ?>

<div id="content" class="site-content">

<?php get_template_part( 'components/header/masthead' ); ?>

<?php if ( ! is_page_template( 'templates/fluid-width.php' ) && ! is_404() ) { ?>
<?php if ( ! is_page_template( 'templates/fluid-width.php' ) && ! is_page_template( 'templates/blank.php' ) && ! is_404() ) { ?>
<div class="row">
<?php } ?>
37 changes: 37 additions & 0 deletions templates/blank.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php
/**
* Template Name: Blank
*
* The template for displaying pages with no header or footer.
*
* @package Memberlite
*/

get_header(); ?>

<div id="primary" class="content-area">
<?php do_action( 'memberlite_before_main' ); ?>
<main id="main" class="site-main" role="main">
<?php do_action( 'memberlite_before_loop' ); ?>

<?php
while ( have_posts() ) :
the_post();
?>

<?php get_template_part( 'components/page/content', 'page' ); ?>
<?php
// If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || '0' != get_comments_number() ) :
comments_template();
endif;
?>

<?php endwhile; // end of the loop. ?>

<?php do_action( 'memberlite_after_loop' ); ?>
</main><!-- #main -->
<?php do_action( 'memberlite_after_main' ); ?>
</div><!-- #primary -->

<?php get_footer(); ?>

0 comments on commit 4cb42c1

Please sign in to comment.