forked from mirror/_s
Move PHP tags on it’s own line & correct indention
This fixes a few of the errors from the news sniffs in WPCS 0.12.0 and also standardizes the indention between the PHP and HTML
This commit is contained in:
parent
54ad32a598
commit
b26b6ebfa4
4
404.php
4
404.php
|
@ -7,7 +7,8 @@
|
|||
* @package _s
|
||||
*/
|
||||
|
||||
get_header(); ?>
|
||||
get_header();
|
||||
?>
|
||||
|
||||
<div id="primary" class="content-area">
|
||||
<main id="main" class="site-main">
|
||||
|
@ -42,7 +43,6 @@ get_header(); ?>
|
|||
</div><!-- .widget -->
|
||||
|
||||
<?php
|
||||
|
||||
/* translators: %1$s: smiley */
|
||||
$archive_content = '<p>' . sprintf( esc_html__( 'Try looking in the monthly archives. %1$s', '_s' ), convert_smilies( ':)' ) ) . '</p>';
|
||||
the_widget( 'WP_Widget_Archives', 'dropdown=1', "after_title=</h2>$archive_content" );
|
||||
|
|
12
archive.php
12
archive.php
|
@ -7,13 +7,13 @@
|
|||
* @package _s
|
||||
*/
|
||||
|
||||
get_header(); ?>
|
||||
get_header();
|
||||
?>
|
||||
|
||||
<div id="primary" class="content-area">
|
||||
<main id="main" class="site-main">
|
||||
|
||||
<?php
|
||||
if ( have_posts() ) : ?>
|
||||
<?php if ( have_posts() ) : ?>
|
||||
|
||||
<header class="page-header">
|
||||
<?php
|
||||
|
@ -24,7 +24,8 @@ get_header(); ?>
|
|||
|
||||
<?php
|
||||
/* Start the Loop */
|
||||
while ( have_posts() ) : the_post();
|
||||
while ( have_posts() ) :
|
||||
the_post();
|
||||
|
||||
/*
|
||||
* Include the Post-Format-specific template for the content.
|
||||
|
@ -41,7 +42,8 @@ get_header(); ?>
|
|||
|
||||
get_template_part( 'template-parts/content', 'none' );
|
||||
|
||||
endif; ?>
|
||||
endif;
|
||||
?>
|
||||
|
||||
</main><!-- #main -->
|
||||
</div><!-- #primary -->
|
||||
|
|
|
@ -24,7 +24,8 @@ if ( post_password_required() ) {
|
|||
|
||||
<?php
|
||||
// You can start editing here -- including this comment!
|
||||
if ( have_comments() ) : ?>
|
||||
if ( have_comments() ) :
|
||||
?>
|
||||
<h2 class="comments-title">
|
||||
<?php
|
||||
$comment_count = get_comments_number();
|
||||
|
@ -56,10 +57,12 @@ if ( post_password_required() ) {
|
|||
?>
|
||||
</ol><!-- .comment-list -->
|
||||
|
||||
<?php the_comments_navigation();
|
||||
<?php
|
||||
the_comments_navigation();
|
||||
|
||||
// If comments are closed and there are comments, let's leave a little note, shall we?
|
||||
if ( ! comments_open() ) : ?>
|
||||
if ( ! comments_open() ) :
|
||||
?>
|
||||
<p class="no-comments"><?php esc_html_e( 'Comments are closed.', '_s' ); ?></p>
|
||||
<?php
|
||||
endif;
|
||||
|
|
|
@ -15,10 +15,12 @@
|
|||
|
||||
<footer id="colophon" class="site-footer">
|
||||
<div class="site-info">
|
||||
<a href="<?php echo esc_url( __( 'https://wordpress.org/', '_s' ) ); ?>"><?php
|
||||
<a href="<?php echo esc_url( __( 'https://wordpress.org/', '_s' ) ); ?>">
|
||||
<?php
|
||||
/* translators: %s: CMS name, i.e. WordPress. */
|
||||
printf( esc_html__( 'Proudly powered by %s', '_s' ), 'WordPress' );
|
||||
?></a>
|
||||
?>
|
||||
</a>
|
||||
<span class="sep"> | </span>
|
||||
<?php
|
||||
/* translators: 1: Theme name, 2: Theme author. */
|
||||
|
|
14
header.php
14
header.php
|
@ -28,18 +28,20 @@
|
|||
<div class="site-branding">
|
||||
<?php
|
||||
the_custom_logo();
|
||||
if ( is_front_page() && is_home() ) : ?>
|
||||
if ( is_front_page() && is_home() ) :
|
||||
?>
|
||||
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
|
||||
<?php else : ?>
|
||||
<?php
|
||||
else :
|
||||
?>
|
||||
<p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
|
||||
<?php
|
||||
endif;
|
||||
|
||||
$description = get_bloginfo( 'description', 'display' );
|
||||
if ( $description || is_customize_preview() ) : ?>
|
||||
if ( $description || is_customize_preview() ) :
|
||||
?>
|
||||
<p class="site-description"><?php echo $description; /* WPCS: xss ok. */ ?></p>
|
||||
<?php
|
||||
endif; ?>
|
||||
<?php endif; ?>
|
||||
</div><!-- .site-branding -->
|
||||
|
||||
<nav id="site-navigation" class="main-navigation">
|
||||
|
|
13
index.php
13
index.php
|
@ -12,7 +12,8 @@
|
|||
* @package _s
|
||||
*/
|
||||
|
||||
get_header(); ?>
|
||||
get_header();
|
||||
?>
|
||||
|
||||
<div id="primary" class="content-area">
|
||||
<main id="main" class="site-main">
|
||||
|
@ -20,16 +21,17 @@ get_header(); ?>
|
|||
<?php
|
||||
if ( have_posts() ) :
|
||||
|
||||
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;
|
||||
|
||||
/* Start the Loop */
|
||||
while ( have_posts() ) : the_post();
|
||||
while ( have_posts() ) :
|
||||
the_post();
|
||||
|
||||
/*
|
||||
* Include the Post-Format-specific template for the content.
|
||||
|
@ -46,7 +48,8 @@ get_header(); ?>
|
|||
|
||||
get_template_part( 'template-parts/content', 'none' );
|
||||
|
||||
endif; ?>
|
||||
endif;
|
||||
?>
|
||||
|
||||
</main><!-- #main -->
|
||||
</div><!-- #primary -->
|
||||
|
|
6
page.php
6
page.php
|
@ -12,13 +12,15 @@
|
|||
* @package _s
|
||||
*/
|
||||
|
||||
get_header(); ?>
|
||||
get_header();
|
||||
?>
|
||||
|
||||
<div id="primary" class="content-area">
|
||||
<main id="main" class="site-main">
|
||||
|
||||
<?php
|
||||
while ( have_posts() ) : the_post();
|
||||
while ( have_posts() ) :
|
||||
the_post();
|
||||
|
||||
get_template_part( 'template-parts/content', 'page' );
|
||||
|
||||
|
|
18
search.php
18
search.php
|
@ -7,24 +7,27 @@
|
|||
* @package _s
|
||||
*/
|
||||
|
||||
get_header(); ?>
|
||||
get_header();
|
||||
?>
|
||||
|
||||
<section id="primary" class="content-area">
|
||||
<main id="main" class="site-main">
|
||||
|
||||
<?php
|
||||
if ( have_posts() ) : ?>
|
||||
<?php if ( have_posts() ) : ?>
|
||||
|
||||
<header class="page-header">
|
||||
<h1 class="page-title"><?php
|
||||
<h1 class="page-title">
|
||||
<?php
|
||||
/* translators: %s: search query. */
|
||||
printf( esc_html__( 'Search Results for: %s', '_s' ), '<span>' . get_search_query() . '</span>' );
|
||||
?></h1>
|
||||
?>
|
||||
</h1>
|
||||
</header><!-- .page-header -->
|
||||
|
||||
<?php
|
||||
/* Start the Loop */
|
||||
while ( have_posts() ) : the_post();
|
||||
while ( have_posts() ) :
|
||||
the_post();
|
||||
|
||||
/**
|
||||
* Run the loop for the search to output the results.
|
||||
|
@ -41,7 +44,8 @@ get_header(); ?>
|
|||
|
||||
get_template_part( 'template-parts/content', 'none' );
|
||||
|
||||
endif; ?>
|
||||
endif;
|
||||
?>
|
||||
|
||||
</main><!-- #main -->
|
||||
</section><!-- #primary -->
|
||||
|
|
|
@ -7,13 +7,15 @@
|
|||
* @package _s
|
||||
*/
|
||||
|
||||
get_header(); ?>
|
||||
get_header();
|
||||
?>
|
||||
|
||||
<div id="primary" class="content-area">
|
||||
<main id="main" class="site-main">
|
||||
|
||||
<?php
|
||||
while ( have_posts() ) : the_post();
|
||||
while ( have_posts() ) :
|
||||
the_post();
|
||||
|
||||
get_template_part( 'template-parts/content', get_post_type() );
|
||||
|
||||
|
|
|
@ -16,11 +16,10 @@
|
|||
|
||||
<div class="page-content">
|
||||
<?php
|
||||
if ( is_home() && current_user_can( 'publish_posts' ) ) : ?>
|
||||
if ( is_home() && current_user_can( 'publish_posts' ) ) :
|
||||
|
||||
<p><?php
|
||||
printf(
|
||||
wp_kses(
|
||||
'<p>' . wp_kses(
|
||||
/* translators: 1: link to WP admin new post page. */
|
||||
__( 'Ready to publish your first post? <a href="%1$s">Get started here</a>.', '_s' ),
|
||||
array(
|
||||
|
@ -28,23 +27,25 @@
|
|||
'href' => array(),
|
||||
),
|
||||
)
|
||||
),
|
||||
) . '</p>',
|
||||
esc_url( admin_url( 'post-new.php' ) )
|
||||
);
|
||||
?></p>
|
||||
|
||||
<?php elseif ( is_search() ) : ?>
|
||||
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();
|
||||
|
||||
else : ?>
|
||||
else :
|
||||
?>
|
||||
|
||||
<p><?php esc_html_e( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', '_s' ); ?></p>
|
||||
<?php
|
||||
get_search_form();
|
||||
|
||||
endif; ?>
|
||||
endif;
|
||||
?>
|
||||
</div><!-- .page-content -->
|
||||
</section><!-- .no-results -->
|
||||
|
|
|
@ -18,15 +18,15 @@
|
|||
the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
|
||||
endif;
|
||||
|
||||
if ( 'post' === get_post_type() ) : ?>
|
||||
if ( 'post' === get_post_type() ) :
|
||||
?>
|
||||
<div class="entry-meta">
|
||||
<?php
|
||||
_s_posted_on();
|
||||
_s_posted_by();
|
||||
?>
|
||||
</div><!-- .entry-meta -->
|
||||
<?php
|
||||
endif; ?>
|
||||
<?php endif; ?>
|
||||
</header><!-- .entry-header -->
|
||||
|
||||
<?php _s_post_thumbnail(); ?>
|
||||
|
|
Reference in New Issue