'; // WPCS: XSS OK.
}
endif;
// Prints HTML with meta information for the current author.
if ( ! function_exists( 'blog_writer_posted_by' ) ) :
function blog_writer_posted_by() {
$byline = sprintf(
/* translators: %s: post author. */
esc_html_x( 'by %s', 'post author', 'blog-writer' ),
'' . esc_html( get_the_author() ) . ''
);
echo '
' . $byline . '
'; // WPCS: XSS OK.
}
endif;
// Add categories to the post meta info
if ( ! function_exists( 'blog_writer_categories' ) ) :
function blog_writer_categories() {
$categories_list = get_the_category_list( esc_html__( ', ', 'blog-writer' ) );
if ( $categories_list ) {
/* translators: 1: list of categories. */
printf( '
' . esc_html__( 'In %1$s', 'blog-writer' ) . '
', $categories_list ); // WPCS: XSS OK.
}
}
endif;
if ( ! function_exists( 'blog_writer_comments_count' ) ) :
function blog_writer_comments_count() {
// Add the comments link to the post meta info
if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
echo '
';
comments_popup_link(
sprintf(
wp_kses(
/* translators: %s: post title */
__( 'Leave a Comment on %s', 'blog-writer' ),
array(
'span' => array(
'class' => array(),
),
)
),
get_the_title()
)
);
echo '
';
}
}
endif;
if ( ! function_exists( 'blog_writer_entry_footer' ) ) :
//Prints HTML with meta information for the tags
function blog_writer_entry_footer() {
// Hide category and tag text for pages.
if ( 'post' === get_post_type() ) {
// Get tag list
if(get_the_tag_list()) {
echo '
'));
}
}
}
endif;
/**
* Displays an optional post thumbnail.
* Wraps the post thumbnail in an anchor element on index views, or a div element when on single views.
*/
if ( ! function_exists( 'blog_writer_post_thumbnail' ) ) :
function blog_writer_post_thumbnail() {
if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) {
return;
}
if ( is_singular() ) :
?>