%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( 'd M Y' ) ), esc_attr( get_the_modified_date( DATE_W3C ) ), esc_html( get_the_modified_date( 'd M Y' ) ) ); echo '' . wp_kses_post( $time_string ) . ''; } endif; if ( ! function_exists( 'blogz_posted_by' ) ) : /** * Prints HTML with meta information for the current author. * * @param string $prefix Prefix before author name. */ function blogz_posted_by( $prefix = '' ) { if ( 'text' === $prefix ) { $prefix = esc_html__( 'By ', 'blogz' ); } elseif ( 'icon' === $prefix ) { $prefix = ''; } $byline = '' . $prefix . esc_html( get_the_author() ) . ''; echo ' ' . wp_kses_post( $byline ) . ''; } endif; if ( ! function_exists( 'blogz_entry_footer' ) ) : /** * Prints HTML with meta information for the categories, tags and comments. */ function blogz_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 */ $tags_list = get_the_tag_list(); if ( $tags_list ) { /* translators: 1: list of tags. */ printf( '%1$s', wp_kses_post( $tags_list ) ); } } if ( function_exists( 'sharing_display' ) ) { sharing_display( '', true ); } blogz_edit_link(); } endif; /** * Edit Link. */ function blogz_edit_link() { edit_post_link( sprintf( wp_kses( /* translators: %s: Name of current post. Only visible to screen readers */ __( 'Edit %s', 'blogz' ), array( 'span' => array( 'class' => array(), ), ) ), get_the_title() ), '', '' ); } if ( ! function_exists( 'blogz_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. * * @param string $size thumbnail size. */ function blogz_post_thumbnail( $size = 'post-thumbnail' ) { if ( is_attachment() ) { return; } if ( is_singular() && ! is_front_page() ) : ?>
term_id ); $name = $categories[0]->name; $color = get_theme_mod( 'category_color' ); $html = ''; $background = ''; if ( ! empty( $color ) && $has_background ) { $background = 'style="background-color:' . esc_attr( $color ) . '"'; } printf( ' %s ', wp_kses_post( $background ), esc_url( $link ), esc_html( $name ) ); } /** * Prints HTML with meta information for the comment number. */ function blogz_print_comment_link() { $comment_number = get_comments_number(); $text = esc_html( _nx( 'Comment: ', 'Comments: ', $comment_number, 'comments', 'blogz' ) ); if ( in_the_loop() && ! is_single() && ! $comment_number ) { return; } if ( ! post_password_required() && ( comments_open() || $comment_number ) ) { ?> ', esc_url( $social_value ), esc_html( $social ) ); } if ( empty( $output ) ) { return ''; } echo ''; } /** * Author Box. */ function blogz_author_box() { $author_id = get_the_author_meta( 'ID' ); $author_website = get_the_author_meta( 'user_url', $author_id ); if ( ! empty( $author_website ) ) { $author_website_link = sprintf( '%s', esc_url( $author_website ), esc_html__( 'Visit Website', 'blogz' ) ); } ?>
' . get_the_author() . '' ); ?>
@%s', 'blogz' ), esc_html( $twitter ), esc_html( get_the_author_meta( 'twitter' ) ) ); } ?>
%s', esc_url( $author_website ), esc_html__( 'Visit Website', 'blogz' ) ); } ?>
' . get_the_author() . '' ); ?>
'; if ( $echo ) { echo wp_kses_post( $image_default ); return; } return $image_default; } /** * * Get image alt from image url * * @param string $url image url. */ function blogz_get_image_alt( $url ) { $image_id = attachment_url_to_postid( $url ); return ( ! empty( $image_id ) ) ? get_post_meta( $image_id, '_wp_attachment_image_alt', true ) : ''; }