From 37f062ca05170558c1886422249eb6b1012ccc82 Mon Sep 17 00:00:00 2001 From: Brad Parbs Date: Tue, 15 Jun 2021 17:09:14 -0500 Subject: [PATCH] Move check for comments being open & if comments, then calling comments_template() to a template tag --- inc/template-tags.php | 11 +++++++++++ single.php | 5 +---- template-sidebar-right.php | 5 +---- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/inc/template-tags.php b/inc/template-tags.php index 25c5a4509..fb2050263 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -441,3 +441,14 @@ function _s_display_mobile_menu() { diff --git a/template-sidebar-right.php b/template-sidebar-right.php index 9650ea07d..987c048d8 100644 --- a/template-sidebar-right.php +++ b/template-sidebar-right.php @@ -20,10 +20,7 @@ get_template_part( 'template-parts/content', 'page' ); - // If comments are open or we have at least one comment, load up the comment template. - if ( comments_open() || get_comments_number() ) : - comments_template(); - endif; + _s_display_comments(); endwhile; // End of the loop. ?>