diff --git a/inc/template-tags.php b/inc/template-tags.php index fb2d4534..164970ab 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -9,7 +9,7 @@ if ( ! function_exists( '_s_posted_on' ) ) : /** - * Prints HTML with meta information for the current post-date/time and author. + * Prints HTML with meta information for the current post-date/time. */ function _s_posted_on() { $time_string = ''; @@ -30,13 +30,23 @@ if ( ! function_exists( '_s_posted_on' ) ) : '' . $time_string . '' ); + echo '' . $posted_on . ''; // WPCS: XSS OK. + + } +endif; + +if ( ! function_exists( '_s_posted_by' ) ) : + /** + * Prints HTML with meta information for the current author. + */ + function _s_posted_by() { $byline = sprintf( /* translators: %s: post author. */ esc_html_x( 'by %s', 'post author', '_s' ), ' ' ); - echo '' . $posted_on . ' '; // WPCS: XSS OK. + echo ' '; // WPCS: XSS OK. } endif; diff --git a/template-parts/content-search.php b/template-parts/content-search.php index 689d64a7..4068b8bb 100644 --- a/template-parts/content-search.php +++ b/template-parts/content-search.php @@ -15,7 +15,10 @@
diff --git a/template-parts/content.php b/template-parts/content.php index d77f32f7..a74522cd 100644 --- a/template-parts/content.php +++ b/template-parts/content.php @@ -20,7 +20,10 @@ if ( 'post' === get_post_type() ) : ?>