' . $posted_on . ''; // WPCS: XSS OK. } } endif; if ( ! function_exists( 'gucherry_blog_posted_by' ) ) : /** * Prints HTML with meta information for the current author. */ function gucherry_blog_posted_by( $display_meta ) { if( $display_meta == true && get_post_type() == 'post' ) { $byline = sprintf( /* translators: %s: post author. */ esc_html_x( 'by %s', 'post author', 'gucherry-blog' ), '' . esc_html( get_the_author() ) . '' ); echo '
  • ' . $byline . '
  • '; // WPCS: XSS OK. } } endif; if ( ! function_exists( 'gucherry_blog_comments_no_meta' ) ) : /** * Prints HTML with meta information for no of comments. */ function gucherry_blog_comments_no_meta( $display_meta ) { if( $display_meta == true && get_post_type() === 'post' ) { if( ( comments_open() || get_comments_number() ) ) { ?>
  • ' . wp_kses_post( $categories_list ) . ''; // WPCS: XSS OK. } } } } endif; if( ! function_exists( 'gucherry_blog_post_read_time' ) ) : /* * Prints HTML with meta information for post read time. */ function gucherry_blog_post_read_time( $display_meta ) { if( $display_meta == true && get_post_type() == 'post' ) { $post_id = get_the_ID(); $post_object = get_post( $post_id ); $content = $post_object->post_content; $word_count = str_word_count( strip_tags( $content ) ); $per_min_words = absint( 240 ); $total_time = round( ($word_count)/($per_min_words) ); if( $total_time > 1 ) { $time_unit = esc_html__( ' minutes', 'gucherry-blog' ); } else { $time_unit = esc_html__( ' minute', 'gucherry-blog' ); } echo '
  • ' . esc_html__( 'Read Time: ', 'gucherry-blog' ) . '' . esc_html( $total_time ) . esc_html( $time_unit ) . '
  • '; } } endif; if( ! function_exists( 'gucherry_blog_tags_meta' ) ) : /* * Prints HTML with meta information for post categories. */ function gucherry_blog_tags_meta( $display_meta ) { if( $display_meta == true ) { // Hide category and tag text for pages. if ( 'post' === get_post_type() ) { /* translators: used between list items, there is a space after the comma */ $tags_list = get_the_tag_list(); if ( $tags_list ) { echo '
    ' . wp_kses_post( $tags_list ) . '
    '; // WPCS: XSS OK. } } } } endif; if ( ! function_exists( 'gucherry_blog_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 gucherry_blog_post_thumbnail() { if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { return; } if ( is_singular() || is_page() ) { ?>
    the_title_attribute( array( 'echo' => false ) ) ) ); ?>