%2$s';
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 = sprintf(
_x( 'on %s', 'post date', 'avani' ),
'' . $time_string . ''
);
$byline = sprintf(
_x( 'Written by %s', 'post author', 'avani' ),
''
);
echo '' . $posted_on . '';
edit_post_link(
sprintf(
/* translators: %s: Name of current post */
__( 'Edit Post%s', 'avani' ),
the_title( '"', '"', false )
),
'',
''
);
}
endif;
if ( ! function_exists( 'avani_entry_footer' ) ) :
/**
* Prints HTML with meta information for the categories, tags and comments.
*/
function avani_entry_footer() {
// Hide category and tag text for pages.
if ( is_singular( 'post' ) ) {
/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list( __( ', ', 'avani' ) );
if ( $categories_list && avani_categorized_blog() ) {
printf( '' . __( 'Posted in %1$s', 'avani' ) . '', $categories_list );
}
/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list( '', __( ', ', 'avani' ) );
if ( $tags_list ) {
printf( '', $tags_list );
}
}
}
endif;
/**
* Returns true if a blog has more than 1 category.
*
* @return bool
*/
function avani_categorized_blog() {
if ( false === ( $all_the_cool_cats = get_transient( 'avani_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( 'avani_categories', $all_the_cool_cats );
}
if ( $all_the_cool_cats > 1 ) {
// This blog has more than 1 category so avani_categorized_blog should return true.
return true;
} else {
// This blog has only 1 category so avani_categorized_blog should return false.
return false;
}
}
if ( ! function_exists( 'avani_the_custom_logo' ) ) :
/**
* Displays the optional custom logo.
*
* Does nothing if the custom logo is not available.
*/
function avani_the_custom_logo() {
if ( function_exists( 'the_custom_logo' ) ) {
the_custom_logo();
}
}
endif;
if ( ! function_exists( 'avani_the_custom_header' ) ) :
/**
* Displays the custom header.
*
* Does nothing if the custom header is not available.
*/
function avani_the_custom_header() {
if ( get_header_image() ) {
if ( 1 === get_theme_mod( 'avani_header_on_home_only', '' ) && ! ( is_home() || is_front_page() ) ) {
return;
}
?>