Avoid going in and out of PHP unnecessarily.
Closes #854 Includes minor alignment changes for easier readability/detection of start/end of conditions.
This commit is contained in:
parent
6f6de25568
commit
8470f55f92
13 changed files with 128 additions and 109 deletions
41
index.php
41
index.php
|
@ -17,39 +17,40 @@ get_header(); ?>
|
|||
<div id="primary" class="content-area">
|
||||
<main id="main" class="site-main" role="main">
|
||||
|
||||
<?php if ( have_posts() ) : ?>
|
||||
<?php
|
||||
if ( have_posts() ) :
|
||||
|
||||
<?php if ( is_home() && ! is_front_page() ) : ?>
|
||||
if ( is_home() && ! is_front_page() ) : ?>
|
||||
<header>
|
||||
<h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1>
|
||||
</header>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php /* Start the Loop */ ?>
|
||||
<?php while ( have_posts() ) : the_post(); ?>
|
||||
<?php
|
||||
endif;
|
||||
|
||||
<?php
|
||||
/* Start the Loop */
|
||||
while ( have_posts() ) : the_post();
|
||||
|
||||
/*
|
||||
* Include the Post-Format-specific template for the content.
|
||||
* If you want to override this in a child theme, then include a file
|
||||
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
|
||||
*/
|
||||
get_template_part( 'template-parts/content', get_post_format() );
|
||||
?>
|
||||
/*
|
||||
* Include the Post-Format-specific template for the content.
|
||||
* If you want to override this in a child theme, then include a file
|
||||
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
|
||||
*/
|
||||
get_template_part( 'template-parts/content', get_post_format() );
|
||||
|
||||
<?php endwhile; ?>
|
||||
endwhile;
|
||||
|
||||
<?php the_posts_navigation(); ?>
|
||||
the_posts_navigation();
|
||||
|
||||
<?php else : ?>
|
||||
else :
|
||||
|
||||
<?php get_template_part( 'template-parts/content', 'none' ); ?>
|
||||
get_template_part( 'template-parts/content', 'none' );
|
||||
|
||||
<?php endif; ?>
|
||||
endif; ?>
|
||||
|
||||
</main><!-- #main -->
|
||||
</div><!-- #primary -->
|
||||
|
||||
<?php get_sidebar(); ?>
|
||||
<?php get_footer(); ?>
|
||||
<?php
|
||||
get_sidebar();
|
||||
get_footer();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue