%s', 'pliska' ), array( 'span' => array( 'class' => array(), ), ) ), wp_kses_post( get_the_title() ) ), '', '' ); } endif; /** * Prints the post author. */ if ( ! function_exists( 'pliska_posted_by' ) ) : function pliska_posted_by() { if ( 'post' !== get_post_type() ) { return; } global $post; $show_post_author = get_theme_mod( 'show_post_author', 1 ); $author_id = $post->post_author; $customizer_class = ! $show_post_author && is_customize_preview() ? ' hide' : ''; if ( $show_post_author || is_customize_preview() ) { echo sprintf( 'Post author' . '
' . '' . '' . '
', esc_url( get_author_posts_url( get_the_author_meta( 'ID', $author_id ) ) ), sprintf( esc_attr__( 'View all posts by %s', 'pliska' ), wp_kses( get_the_author_meta( 'display_name', $author_id ), array() ) ), wp_kses( get_the_author_meta( 'display_name', $author_id ), array() ) ); } } endif; /** * Print the post categories. */ /* translators: used between list items, there is a space after the comma */ if ( ! function_exists( 'pliska_posted_in' ) ) : function pliska_posted_in() { if ( 'post' !== get_post_type() ) { return; } $display_category_list = get_theme_mod( 'show_post_categories', 1 ); if ( $display_category_list || is_customize_preview() ) { $category_list = get_the_category_list( esc_html( ' ' ) ); ?> %2$s'; $time_string = sprintf( $time_string, esc_attr( get_the_date( DATE_W3C ) ), esc_html( get_the_date() ) ); $posted_on = sprintf( esc_html( '%s', 'post date' ), '' . $time_string . '' ); echo '' . __( 'Post date', 'pliska' ) . '' , $posted_on , ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } } endif; /** * Display last modified date. */ if ( ! function_exists( 'pliska_updated_on' ) ) : function pliska_updated_on() { if ( 'post' !== get_post_type() ) { return; } // check user settings in theme customizer $show_modified_date = get_theme_mod( 'show_modified_date', 1 ); if ( $show_modified_date || is_customize_preview() ) { $time_string = ''; $time_string = sprintf( $time_string, esc_attr( get_the_modified_date( DATE_W3C ) ), esc_html( get_the_modified_date() ) ); $updated_on = sprintf( esc_html_x( 'Updated %s', 'post date', 'pliska' ), '' . $time_string . '' ); echo '' . __( 'Post last updated date', 'pliska' ) . '' , $updated_on , ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } } endif; /** * Print post reading time */ function pliska_blog_read_time() { if ( 'post' !== get_post_type() ) { return; } $show_time_to_read = get_theme_mod( 'show_time_to_read', 1 ); if ( $show_time_to_read || is_customize_preview() ) { global $post; $words_per_minute = 225; $words_per_second = $words_per_minute / 60; // Count the words in the content. $word_count = str_word_count( strip_tags( $post->post_content ) ); // [UNUSED] How many minutes? $minutes = floor( $word_count / $words_per_minute ); // [UNUSED] How many seconds (remainder)? $seconds_remainder = floor( $word_count % $words_per_minute / $words_per_second ); // How many seconds (total)? $seconds_total = floor( $word_count / $words_per_second ); printf( '' . __( 'Post read time', 'pliska' ) . '' . wp_kses( pliska_get_svg( 'clock' ), pliska_get_kses_extended_ruleset() ) . '' . wp_kses_post( pliska_blog_convert_read_time( $seconds_total ) . ' ' ) ); } } function pliska_blog_convert_read_time( $seconds ) { $string = ''; $days = intval( intval( $seconds ) / ( 3600 * 24 ) ); $hours = ( intval( $seconds ) / 3600 ) % 24; $minutes = ( intval( $seconds ) / 60 ) % 60; $seconds = ( intval( $seconds ) ) % 60; if ( $days > 0 ) { $string .= "$days " . esc_html__( 'days read', 'pliska' ); return $string; } if ( $hours > 0 ) { $string .= "$hours " . esc_html__( 'hrs read', 'pliska' ); return $string; } if ( $minutes > 0 ) { $string .= "$minutes " . esc_html__( 'min read', 'pliska' ); return $string; } if ( $seconds > 0 ) { $string .= "$seconds " . esc_html__( 'sec read', 'pliska' ); return $string; } return $string; } if ( ! function_exists( 'pliska_comments' ) ) : function pliska_comments() { $display_comments = get_theme_mod( 'show_post_comments', 1 ); if ( $display_comments || is_customize_preview() ) { if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { $no_of_comments = get_comments_number( get_the_ID() ); echo '' . wp_kses( pliska_get_svg( 'comment' ), pliska_get_kses_extended_ruleset() ) . ''; echo absint( $no_of_comments ); echo ''; } } } endif; if ( ! function_exists( 'pliska_tags' ) ) : function pliska_tags() { $display_tag_list = get_theme_mod( 'show_post_tags', 1 ); // Hide tags for pages. if ( 'page' !== get_post_type() ) { if ( $display_tag_list || is_customize_preview() ) { /* translators: used between list items, there is a space after the comma */ $tags_list = get_the_tag_list( '', esc_html( ', ' ) ); if ( $tags_list ) { /* translators: 1: list of tags. */ printf( '' . __( 'Post tags', 'pliska' ) . '' . wp_kses( pliska_get_svg( 'tag' ), pliska_get_kses_extended_ruleset() ) . esc_html( '%s' ) . '', $tags_list ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } } } } endif; /** * Prints post tags and comments. */ if ( ! function_exists( 'pliska_entry_footer' ) ) : function pliska_entry_footer() { pliska_tags(); pliska_comments(); } endif; if ( ! function_exists( 'pliska_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 pliska_post_thumbnail( $size = '' ) { if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { return; } ?> || show_toggles ) ) { $args->after = ''; // Add a toggle to items with children. if ( in_array( 'menu-item-has-children', $item->classes, true ) || in_array( 'page_item_has_children', $item->classes, true ) ) { // Add the sub menu toggle. $args->after .= ''; } } return $args; } add_filter( 'nav_menu_item_args', 'pliska_add_sub_toggles_to_main_menu', 10, 3 ); /* Add search list item to top menu bar */ function pliska_add_search_box() { ?>
  • comment_type ) : case 'pingback': case 'trackback': ?>
  • id="comment-">
    comment_approved == '0' ) : ?>
    pliska_schema_microdata( 'image', 0 ) ) ); ?>
    >
    > %s', get_comment_author_link() ) ); ?>
    ' ' . __( 'Reply', 'pliska' ), 'depth' => $depth, 'max_depth' => $args['max_depth'], ) ) ); ?>
    closed by wp_comments_list() }