diff --git a/inc/template-tags.php b/inc/template-tags.php index a9a1f1b03e..c19fc8e9b4 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -61,7 +61,7 @@ function _s_entry_footer() { if ( 'post' === get_post_type() ) { /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list( esc_html__( ', ', '_s' ) ); - if ( $categories_list ) { + if ( $categories_list && has_category() ) { /* translators: 1: list of categories. */ printf( '' . esc_html__( 'Posted in %1$s', '_s' ) . '', $categories_list ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped }