%2$s',
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_html( get_the_author() )
);
echo ' ' . $author . '';
}
/**
* Prints HTML with meta information for the current post-date.
*/
function azeria_post_date() {
$time_string = '';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
$time_string = '';
}
$time_string = sprintf( $time_string,
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_attr( get_the_modified_date( 'c' ) ),
esc_html( get_the_modified_date() )
);
$posted_on = '' . $time_string . '';
echo ' ' . $posted_on . ''; // WPCS: XSS OK.
}
/**
* Prints HTML with meta information for the current post-date.
*/
function azeria_post_comments() {
if ( post_password_required() || ! comments_open() ) {
return;
}
echo ' ';
comments_popup_link( esc_html__( 'Leave a comment', 'azeria' ), esc_html__( '1 Comment', 'azeria' ), esc_html__( '% Comments', 'azeria' ) );
echo '';
}
function azeria_post_categories() {
// Hide category and tag text for pages.
if ( 'post' != get_post_type() ) {
return;
}
$categories_list = get_the_category_list( esc_html__( ', ', 'azeria' ) );
if ( $categories_list && azeria_categorized_blog() ) {
printf( ' ' . esc_html__( 'Posted in %1$s', 'azeria' ) . '', $categories_list ); // WPCS: XSS OK.
}
}
/**
* Prints HTML with meta information for the categories, tags and comments.
*/
function azeria_post_tags() {
// Hide category and tag text for pages.
if ( 'post' != get_post_type() ) {
return;
}
$tags_list = get_the_tag_list( '', esc_html__( ', ', 'azeria' ) );
if ( $tags_list ) {
printf( ' ' . esc_html__( 'Tagged %1$s', 'azeria' ) . '', $tags_list ); // WPCS: XSS OK.
}
}
/**
* Returns true if a blog has more than 1 category.
*
* @return bool
*/
function azeria_categorized_blog() {
if ( false === ( $all_the_cool_cats = get_transient( 'azeria_categories' ) ) ) {
// Create an array of all the categories that are attached to posts.
$all_the_cool_cats = get_categories( array(
'fields' => 'ids',
'hide_empty' => 1,
// We only need to know if there is more than one category.
'number' => 2,
) );
// Count the number of categories that are attached to the posts.
$all_the_cool_cats = count( $all_the_cool_cats );
set_transient( 'azeria_categories', $all_the_cool_cats );
}
if ( $all_the_cool_cats > 1 ) {
// This blog has more than 1 category so azeria_categorized_blog should return true.
return true;
} else {
// This blog has only 1 category so azeria_categorized_blog should return false.
return false;
}
}
/**
* Flush out the transients used in azeria_categorized_blog.
*/
function azeria_category_transient_flusher() {
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
return;
}
// Like, beat it. Dig?
delete_transient( 'azeria_categories' );
}
add_action( 'edit_category', 'azeria_category_transient_flusher' );
add_action( 'save_post', 'azeria_category_transient_flusher' );
/**
* Show site logo markup depending from site options
*/
function azeria_logo() {
$logo_img = azeria_get_option( 'logo_img' );
$logo_tag = 'h2';
if ( is_front_page() ) {
$logo_tag = 'h1';
}
if ( false != $logo_img ) {
$logo_content = '';
} else {
$logo_content = get_bloginfo( 'name' );
}
printf( '<%1$s class="site-logo">%3$s%1$s>', $logo_tag, esc_url( home_url( '/' ) ), $logo_content );
}
/**
* Show posts listing content depending from options
*/
function azeria_blog_content() {
$blog_content = azeria_get_option( 'blog_content', 'excerpt' );
if ( 'excerpt' == $blog_content ) {
the_excerpt();
return;
}
/* translators: %s: Name of current post */
the_content( sprintf(
wp_kses( __( 'Continue reading %s →', 'azeria' ), array( 'span' => array( 'class' => array() ) ) ),
the_title( '"', '"', false )
) );
wp_link_pages( array(
'before' => '