From f12b72e965c6af54bc20e5d360be8866c7bb3d72 Mon Sep 17 00:00:00 2001 From: James Koster Date: Mon, 18 Aug 2014 13:23:00 +0100 Subject: [PATCH] single post / page --- inc/structure/comments.php | 10 ++++++++++ inc/structure/hooks.php | 9 +++++++++ page.php | 12 ++++++++---- single.php | 16 ++++++++-------- 4 files changed, 35 insertions(+), 12 deletions(-) diff --git a/inc/structure/comments.php b/inc/structure/comments.php index a6a8e963..29056460 100644 --- a/inc/structure/comments.php +++ b/inc/structure/comments.php @@ -5,6 +5,16 @@ * @package storefront */ +/** + * Storefront display comments + */ +function storefront_display_comments() { + // 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; +} + /** * Storefront comment template * @since 1.0.0 diff --git a/inc/structure/hooks.php b/inc/structure/hooks.php index 166131c0..b1b5996d 100644 --- a/inc/structure/hooks.php +++ b/inc/structure/hooks.php @@ -59,24 +59,33 @@ add_action( 'homepage', 'storefront_on_sale_products', 60 ); * @see storefront_post_content() * @see storefront_paging_nav() * @see storefront_single_post_header() + * @see storefront_post_nav() + * @see storefront_display_comments() */ add_action( 'storefront_loop_post', 'storefront_post_header', 10 ); add_action( 'storefront_loop_post', 'storefront_post_meta', 20 ); add_action( 'storefront_loop_post', 'storefront_post_content', 30 ); + add_action( 'storefront_loop_after', 'storefront_paging_nav', 10 ); add_action( 'storefront_single_post', 'storefront_post_header', 10 ); add_action( 'storefront_single_post', 'storefront_post_meta', 20 ); add_action( 'storefront_single_post', 'storefront_post_content', 30 ); +add_action( 'storefront_single_post_after', 'storefront_post_nav', 10 ); +add_action( 'storefront_single_post_after', 'storefront_display_comments', 10 ); + /** * Pages * @see storefront_page_header() * @see storefront_page_content() + * @see storefront_display_comments() */ add_action( 'storefront_page', 'storefront_page_header', 10 ); add_action( 'storefront_page', 'storefront_page_content', 20 ); +add_action( 'storefront_page_after', 'storefront_display_comments', 10 ); + /** * Extras * @see storefront_setup_author() diff --git a/page.php b/page.php index b20c80cb..ba5fab0e 100755 --- a/page.php +++ b/page.php @@ -17,13 +17,17 @@ get_header(); ?> + + diff --git a/single.php b/single.php index d224512b..8093fdea 100755 --- a/single.php +++ b/single.php @@ -12,15 +12,15 @@ get_header(); ?> - - - -