' . $postmeta . '';
}
endif;
if ( ! function_exists( 'admiral_meta_date' ) ) :
/**
* Displays the post date
*/
function admiral_meta_date() {
$time_string = sprintf( '',
esc_url( get_permalink() ),
esc_attr( get_the_time() ),
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() )
);
return '' . $time_string . '';
}
endif;
if ( ! function_exists( 'admiral_meta_author' ) ) :
/**
* Displays the post author
*/
function admiral_meta_author() {
$author_string = sprintf( '%3$s',
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_attr( sprintf( esc_html__( 'View all posts by %s', 'admiral' ), get_the_author() ) ),
esc_html( get_the_author() )
);
return ' ' . $author_string . '';
}
endif;
if ( ! function_exists( 'admiral_meta_comments' ) ) :
/**
* Displays the post comments
*/
function admiral_meta_comments() {
// Check if comments are open or we have at least one comment.
if ( ! ( comments_open() || get_comments_number() ) ) {
return;
}
ob_start();
comments_popup_link( esc_html__( 'No comments', 'admiral' ), esc_html__( 'One comment', 'admiral' ), esc_html__( '% comments', 'admiral' ) );
$comments_string = ob_get_contents();
ob_end_clean();
return ' ' . $comments_string . '';
}
endif;
if ( ! function_exists( 'admiral_meta_category' ) ) :
/**
* Displays the category of posts
*/
function admiral_meta_category() {
return ' ' . get_the_category_list( ', ' ) . '';
}
endif;
if ( ! function_exists( 'admiral_posted_by' ) ) :
/**
* Displays the post author
*/
function admiral_posted_by() {
// Get theme options from database.
$theme_options = admiral_theme_options();
// Only display if activated in settings.
if ( true === $theme_options['meta_author'] || is_customize_preview() ) {
// Get Author Avatar.
$avatar = get_avatar( get_the_author_meta( 'ID' ), 32 );
$byline = sprintf( esc_html_x( 'Posted by %s', 'post author', 'admiral' ), admiral_meta_author() );
echo '
' . $avatar . $byline . '
';
}
}
endif;
if ( ! function_exists( 'admiral_entry_tags' ) ) :
/**
* Displays the post tags on single post view
*/
function admiral_entry_tags() {
// Get tags.
$tag_list = get_the_tag_list( '', '' );
// Display tags.
if ( $tag_list ) : ?>