';
$time_string = sprintf(
$time_string,
esc_attr( get_the_date( DATE_W3C ) ),
esc_html( get_the_date() )
);
} else {
$time_string = '';
$time_string = sprintf(
$time_string,
esc_attr( get_the_modified_date( DATE_W3C ) ),
esc_html( get_the_modified_date() )
);
}
$posted_on = '' . $time_string . '';
if ( $date_only ) {
return get_the_date();
} else {
echo $posted_on; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
}
}
if ( ! function_exists( 'gautam_updated_on' ) ) {
/**
* Prints HTML with meta information for the current post-date/time.
*
* @since 1.0.0
*/
function gautam_updated_on() {
gautam_posted_on( false, false );
}
}
if ( ! function_exists( 'gautam_posted_by' ) ) {
/**
* Prints HTML with meta information for the current author.
*
* @since 1.0.0
*/
function gautam_posted_by() {
global $post;
$author_id = $post->post_author;
$byline = sprintf(
'' . esc_html( get_the_author_meta( 'nickname', $author_id ) ) . ''
);
echo ' ' . $byline . ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
}
if ( ! function_exists( 'gautam_meta_comment' ) ) {
/**
* Prints meta information for comment.
*
* @since 1.0.0
*/
function gautam_meta_comment() {
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', 'gautam' ),
array(
'span' => array(
'class' => array(),
),
)
),
wp_kses_post( get_the_title() )
)
);
echo '';
}
}
}
if ( ! function_exists( 'gautam_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 int $size Optional. Post Thumbnail Size.
* @param int $date Optional. Post Date.
* @param boolean $in_style Optional. Image is added as div or in style.
* @param boolean $background_needed Optional. Should background be added in form of linear gradient.
*
* @since 1.0.0
*/
function gautam_post_thumbnail( $size = 'post-thumbnail', $date = '', $in_style = false, $background_needed = true ) {
if ( post_password_required() || is_attachment() ) {
return;
}
if ( ! has_post_thumbnail() & ! is_singular() ) {
gautam_no_post_thumbnail( $date );
} elseif ( has_post_thumbnail() && gautam_jetpack_featured_image_display() ) {
gautam_blog_post_thumbnail( $date, $size, $in_style );
}
}
}
/**
* Include Text based post thumbnail in case no featured post is provided for given post.
*
* @param string $date Optional. Post date to be included in post thumbnail.
*
* @since 1.0.0
*/
function gautam_no_post_thumbnail( $date = '' ) {
?>