%2$s'; if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { $time_string = ''; } $time_string = sprintf( $time_string, esc_attr( get_the_date( DATE_W3C ) ), esc_html( get_the_date() ), esc_attr( get_the_modified_date( DATE_W3C ) ), esc_html( get_the_modified_date() ) ); $posted_on = sprintf( /* translators: %s: post date. */ esc_html_x( 'Posted on %s', 'post date', 'blogloom' ), '' . $time_string . '' ); echo '' . $posted_on . ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } endif; if ( ! function_exists( 'blogloom_posted_by' ) ) : /** * Prints HTML with meta information for the current author. */ function blogloom_posted_by() { $byline = sprintf( /* translators: %s: post author. */ esc_html_x( 'by %s', 'post author', 'blogloom' ), '' . esc_html( get_the_author() ) . '' ); echo ' ' . $byline . ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } endif; if ( ! function_exists( 'blogloom_entry_footer' ) ) : /** * Prints HTML with meta information for the categories, tags and comments. */ function blogloom_entry_footer() { // Hide category and tag text for pages. 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__( ', ', 'blogloom' ) ); if ( $categories_list ) { /* translators: 1: list of categories. */ printf( '' . esc_html__( 'Posted in %1$s', 'blogloom' ) . '', $categories_list ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } /* translators: used between list items, there is a space after the comma */ $tags_list = get_the_tag_list( '', esc_html_x( ', ', 'list item separator', 'blogloom' ) ); if ( $tags_list ) { /* translators: 1: list of tags. */ printf( '' . esc_html__( 'Tagged %1$s', 'blogloom' ) . '', $tags_list ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } } if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { echo ''; comments_popup_link( sprintf( wp_kses( /* translators: %s: post title */ __( 'Leave a Comment on %s', 'blogloom' ), array( 'span' => array( 'class' => array(), ), ) ), wp_kses_post( get_the_title() ) ) ); echo ''; } edit_post_link( sprintf( wp_kses( /* translators: %s: Name of current post. Only visible to screen readers */ __( 'Edit %s', 'blogloom' ), array( 'span' => array( 'class' => array(), ), ) ), wp_kses_post( get_the_title() ) ), '', '' ); } endif; if ( ! function_exists( 'blogloom_post_thumbnail' ) ) : /** * Displays an optional post thumbnail. * * Wraps the post thumbnail in an anchor element on index views, or a div * element when on single views. */ function blogloom_post_thumbnail() { if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { return; } if ( is_singular() ) : ?>
ID); if (!empty($categories)) { echo '
'; foreach ($categories as $category) { echo '' . esc_html($category->name) . ''; } echo '
'; } } endif; if ( ! function_exists( 'blogloom_entry_options' ) ) : /** * Display post meta options */ function blogloom_entry_options($post, $args = array()) { $defaults = array( 'class' => '', 'entry_date' => true, 'entry_cat' => true, 'entry_author' => true, 'entry_comment' => true, 'entry_view_count' => false, 'entry_read_time' => false, ); $args = wp_parse_args($args, $defaults); echo '
'; // Date if ($args['entry_date']) { echo ' ' . get_the_date('', $post->ID) . ''; } // Author if ($args['entry_author']) { echo ' ' . get_the_author_meta('display_name', $post->post_author) . ''; } // Comments if ($args['entry_comment'] && comments_open($post->ID)) { $comment_count = get_comments_number($post->ID); echo ' ' . $comment_count . ''; } // View count if ($args['entry_view_count']) { $count_key = 'blogloom_post_views_count'; $count = get_post_meta($post->ID, $count_key, true); if ($count == '') { $count = 0; delete_post_meta($post->ID, $count_key); add_post_meta($post->ID, $count_key, '0'); } echo ' ' . $count . ' ' . esc_html__('views', 'blogloom') . ''; } // Read time if ($args['entry_read_time']) { $content = get_post_field('post_content', $post->ID); $word_count = str_word_count(strip_tags($content)); $reading_time = ceil($word_count / 200); // Assuming 200 words per minute reading speed echo ' ' . $reading_time . ' ' . esc_html__('min read', 'blogloom') . ''; } echo '
'; } endif; if ( ! function_exists( 'blogloom_entry_single_footer' ) ) : /** * Display single post footer */ function blogloom_entry_single_footer() { // Display categories and tags $categories_list = get_the_category_list(', '); if ($categories_list) { echo ''; } $tags_list = get_the_tag_list('', ', '); if ($tags_list) { echo ''; } } endif; if ( ! function_exists( 'blogloom_post_navigation' ) ) : /** * Display post navigation */ function blogloom_post_navigation() { the_post_navigation( array( 'prev_text' => '' . esc_html__('Previous:', 'blogloom') . ' %title', 'next_text' => '' . esc_html__('Next:', 'blogloom') . ' %title', ) ); } endif; add_action('blogloom_post_navigation', 'blogloom_post_navigation'); if ( ! function_exists( 'blogloom_author_box' ) ) : /** * Display author box */ function blogloom_author_box($post) { $author_id = $post->post_author; $author_name = get_the_author_meta('display_name', $author_id); $author_description = get_the_author_meta('description', $author_id); $author_url = get_author_posts_url($author_id); $author_avatar = get_avatar($author_id, 100); if (!empty($author_description)) { ?>