From b26b6ebfa4a92d82a69576e69aefe44192350635 Mon Sep 17 00:00:00 2001 From: Ulrich Pogson Date: Tue, 1 Aug 2017 22:27:46 +0200 Subject: [PATCH] =?UTF-8?q?Move=20PHP=20tags=20on=20it=E2=80=99s=20own=20l?= =?UTF-8?q?ine=20&=20correct=20indention?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- 404.php | 16 ++++++------- archive.php | 16 +++++++------ comments.php | 19 ++++++++------- footer.php | 10 ++++---- header.php | 24 ++++++++++--------- inc/custom-header.php | 6 ++--- index.php | 15 +++++++----- page.php | 22 +++++++++-------- search.php | 18 ++++++++------ single.php | 6 +++-- template-parts/content-none.php | 41 ++++++++++++++++---------------- template-parts/content-page.php | 40 +++++++++++++++---------------- template-parts/content.php | 42 ++++++++++++++++----------------- 13 files changed, 148 insertions(+), 127 deletions(-) diff --git a/404.php b/404.php index dc515c3b..ea8c1a20 100644 --- a/404.php +++ b/404.php @@ -7,7 +7,8 @@ * @package _s */ -get_header(); ?> +get_header(); +?>
@@ -29,7 +30,7 @@ get_header(); ?>

    - 'count', 'order' => 'DESC', @@ -37,17 +38,16 @@ get_header(); ?> 'title_li' => '', 'number' => 10, ) ); - ?> + ?>
' . sprintf( esc_html__( 'Try looking in the monthly archives. %1$s', '_s' ), convert_smilies( ':)' ) ) . '

'; + the_widget( 'WP_Widget_Archives', 'dropdown=1', "after_title=$archive_content" ); - /* translators: %1$s: smiley */ - $archive_content = '

' . sprintf( esc_html__( 'Try looking in the monthly archives. %1$s', '_s' ), convert_smilies( ':)' ) ) . '

'; - the_widget( 'WP_Widget_Archives', 'dropdown=1', "after_title=$archive_content" ); - - the_widget( 'WP_Widget_Tag_Cloud' ); + the_widget( 'WP_Widget_Tag_Cloud' ); ?>
diff --git a/archive.php b/archive.php index 9cf53756..84d760ca 100644 --- a/archive.php +++ b/archive.php @@ -7,24 +7,25 @@ * @package _s */ -get_header(); ?> +get_header(); +?>
- + get_template_part( 'template-parts/content', 'none' ); - endif; ?> + endif; + ?>
diff --git a/comments.php b/comments.php index 28ebdbb1..dc2853e1 100644 --- a/comments.php +++ b/comments.php @@ -24,7 +24,8 @@ if ( post_password_required() ) { + if ( have_comments() ) : + ?>

'ol', - 'short_ping' => true, - ) ); + wp_list_comments( array( + 'style' => 'ol', + 'short_ping' => true, + ) ); ?> - + if ( ! comments_open() ) : + ?>

-
- "> + + ?> + | - Automattic' ); - ?> + ?>
diff --git a/header.php b/header.php index 8f020723..c0396e48 100644 --- a/header.php +++ b/header.php @@ -28,27 +28,29 @@
+ if ( is_front_page() && is_home() ) : + ?>

- +

- + if ( $description || is_customize_preview() ) : + ?>

- +
diff --git a/inc/custom-header.php b/inc/custom-header.php index 97b1db28..d42fbadd 100644 --- a/inc/custom-header.php +++ b/inc/custom-header.php @@ -51,16 +51,16 @@ if ( ! function_exists( '_s_header_style' ) ) : + ?> .site-title, .site-description { position: absolute; clip: rect(1px, 1px, 1px, 1px); } - + ?> .site-title a, .site-description { color: #; diff --git a/index.php b/index.php index 39fccd5a..07b627e4 100644 --- a/index.php +++ b/index.php @@ -12,7 +12,8 @@ * @package _s */ -get_header(); ?> +get_header(); +?>
@@ -20,16 +21,17 @@ get_header(); ?> + if ( is_home() && ! is_front_page() ) : + ?>

- - get_template_part( 'template-parts/content', 'none' ); - endif; ?> + endif; + ?>
diff --git a/page.php b/page.php index e04d218f..9c840673 100644 --- a/page.php +++ b/page.php @@ -12,23 +12,25 @@ * @package _s */ -get_header(); ?> +get_header(); +?>
- + endwhile; // End of the loop. + ?>
diff --git a/search.php b/search.php index 9f6b79df..d0914266 100644 --- a/search.php +++ b/search.php @@ -7,24 +7,27 @@ * @package _s */ -get_header(); ?> +get_header(); +?>
- +

get_template_part( 'template-parts/content', 'none' ); - endif; ?> + endif; + ?> diff --git a/single.php b/single.php index b17f8a29..4d60b1e7 100644 --- a/single.php +++ b/single.php @@ -7,13 +7,15 @@ * @package _s */ -get_header(); ?> +get_header(); +?>
+ if ( is_home() && current_user_can( 'publish_posts' ) ) : -

Get started here.', '_s' ), - array( - 'a' => array( - 'href' => array(), - ), - ) - ), - esc_url( admin_url( 'post-new.php' ) ) - ); - ?>

+ printf( + '

' . wp_kses( + /* translators: 1: link to WP admin new post page. */ + __( 'Ready to publish your first post? Get started here.', '_s' ), + array( + 'a' => array( + 'href' => array(), + ), + ) + ) . '

', + esc_url( admin_url( 'post-new.php' ) ) + ); - + elseif ( is_search() ) : + ?>

+ else : + ?>

+ endif; + ?>
diff --git a/template-parts/content-page.php b/template-parts/content-page.php index e26d5d05..b20eff0c 100644 --- a/template-parts/content-page.php +++ b/template-parts/content-page.php @@ -18,34 +18,34 @@
'', - ) ); + wp_link_pages( array( + 'before' => '', + ) ); ?>
diff --git a/template-parts/content.php b/template-parts/content.php index a74522cd..65ab4bb2 100644 --- a/template-parts/content.php +++ b/template-parts/content.php @@ -18,38 +18,38 @@ the_title( '

', '

' ); endif; - if ( 'post' === get_post_type() ) : ?> -
+ if ( 'post' === get_post_type() ) : + ?> + - +
+
"%s"', '_s' ), - array( - 'span' => array( - 'class' => array(), - ), - ) - ), - get_the_title() - ) ); + the_content( sprintf( + wp_kses( + /* translators: %s: Name of current post. Only visible to screen readers */ + __( 'Continue reading "%s"', '_s' ), + array( + 'span' => array( + 'class' => array(), + ), + ) + ), + get_the_title() + ) ); - wp_link_pages( array( - 'before' => '', - ) ); + wp_link_pages( array( + 'before' => '', + ) ); ?>