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:
jrfnl 2015-11-11 22:59:40 +01:00
parent 6f6de25568
commit 8470f55f92
13 changed files with 128 additions and 109 deletions

View file

@ -15,20 +15,23 @@
</header><!-- .page-header -->
<div class="page-content">
<?php if ( is_home() && current_user_can( 'publish_posts' ) ) : ?>
<?php
if ( is_home() && current_user_can( 'publish_posts' ) ) : ?>
<p><?php printf( wp_kses( __( 'Ready to publish your first post? <a href="%1$s">Get started here</a>.', '_s' ), array( 'a' => array( 'href' => array() ) ) ), esc_url( admin_url( 'post-new.php' ) ) ); ?></p>
<?php elseif ( is_search() ) : ?>
<p><?php esc_html_e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', '_s' ); ?></p>
<?php get_search_form(); ?>
<?php
get_search_form();
<?php else : ?>
else : ?>
<p><?php esc_html_e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.', '_s' ); ?></p>
<?php get_search_form(); ?>
<?php
get_search_form();
<?php endif; ?>
endif; ?>
</div><!-- .page-content -->
</section><!-- .no-results -->

View file

@ -15,8 +15,9 @@
</header><!-- .entry-header -->
<div class="entry-content">
<?php the_content(); ?>
<?php
the_content();
wp_link_pages( array(
'before' => '<div class="page-links">' . esc_html__( 'Pages:', '_s' ),
'after' => '</div>',

View file

@ -19,8 +19,9 @@
</header><!-- .entry-header -->
<div class="entry-content">
<?php the_content(); ?>
<?php
the_content();
wp_link_pages( array(
'before' => '<div class="page-links">' . esc_html__( 'Pages:', '_s' ),
'after' => '</div>',
@ -32,4 +33,3 @@
<?php _s_entry_footer(); ?>
</footer><!-- .entry-footer -->
</article><!-- #post-## -->

View file

@ -11,13 +11,15 @@
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>
<?php
the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' );
<?php if ( 'post' === get_post_type() ) : ?>
if ( 'post' === get_post_type() ) : ?>
<div class="entry-meta">
<?php _s_posted_on(); ?>
</div><!-- .entry-meta -->
<?php endif; ?>
<?php
endif; ?>
</header><!-- .entry-header -->
<div class="entry-content">
@ -27,9 +29,7 @@
wp_kses( __( 'Continue reading %s <span class="meta-nav">&rarr;</span>', '_s' ), array( 'span' => array( 'class' => array() ) ) ),
the_title( '<span class="screen-reader-text">"', '"</span>', false )
) );
?>
<?php
wp_link_pages( array(
'before' => '<div class="page-links">' . esc_html__( 'Pages:', '_s' ),
'after' => '</div>',