%1$s%3$s',
sprintf( '%s ', esc_html_x( 'Format', 'Used before post format.', 'akella' ) ),
esc_url( get_post_format_link( $format ) ),
get_post_format_string( $format )
);
}
}
endif;
if ( ! function_exists( 'akella_entry_footer_meta' ) ) :
/**
* Prints HTML with meta information for the tags, author and comments.
*
* Create your own akella_entry_footer_meta() function to override in a child theme.
*/
function akella_entry_footer_meta() {
if ( is_singular() && 'post' === get_post_type() ) {
akella_entry_tags();
}
if ( 'post' === get_post_type() ) {
$author_avatar_size = apply_filters( 'akella_author_avatar_size', 20 );
printf( '%1$s%2$s %4$s',
get_avatar( get_the_author_meta( 'user_email' ), $author_avatar_size ),
esc_html_x( 'Author', 'Used before post author name.', 'akella' ),
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
get_the_author()
);
}
if ( ! is_singular() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
echo '';
comments_popup_link( sprintf( wp_kses( __( 'Leave a comment on %s', 'akella' ), array( 'span' => array( 'class' => array() ) ) ), get_the_title() ) );
echo '';
}
}
endif;
if ( ! function_exists( 'akella_entry_date' ) ) :
/**
* Prints HTML with date information for current post.
*
* Create your own akella_entry_date() function to override in a child theme.
*/
function akella_entry_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' ) ),
get_the_date(),
esc_attr( get_the_modified_date( 'c' ) ),
get_the_modified_date()
);
printf( '%1$s %3$s',
esc_html_x( 'Posted on', 'Used before publish date.', 'akella' ),
esc_url( get_permalink() ),
$time_string
);
}
endif;
if ( ! function_exists( 'akella_entry_categories' ) ) :
/**
* Prints HTML with categories for current post.
*
* Create your own akella_entry_categories() function to override in a child theme.
*/
function akella_entry_categories() {
$categories_list = get_the_category_list( esc_html_x( ', ', 'Used between list items, there is a space after the comma.', 'akella' ) );
if ( $categories_list && akella_categorized_blog() ) {
printf( '%1$s %2$s',
esc_html_x( 'Categories', 'Used before category names.', 'akella' ),
$categories_list
);
}
}
endif;
if ( ! function_exists( 'akella_entry_tags' ) ) :
/**
* Prints HTML with tags for current post.
*
* Create your own akella_entry_tags() function to override in a child theme.
*/
function akella_entry_tags() {
$tags_list = get_the_tag_list( '', wp_kses( _x( ', ', 'Used between list items, there is a space after the comma.', 'akella' ), array( 'span' => array( 'class' => array() ) ) ) );
if ( $tags_list ) {
printf( '%1$s %2$s',
esc_html_x( 'Tags', 'Used before tag names.', 'akella' ),
$tags_list
);
}
}
endif;
if ( ! function_exists( 'akella_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.
*
* Create your own akella_post_thumbnail() function to override in a child theme.
*/
function akella_post_thumbnail() {
if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) {
return;
}
if ( is_singular() ) : ?>
%2$s',
esc_url( get_permalink( get_the_ID() ) ),
/* translators: %s: Name of current post */
sprintf( wp_kses( __( 'Read more "%s"', 'akella' ), array( 'span' => array( 'class' => array() ) ) ), get_the_title( get_the_ID() ) )
);
return ' … ' . $link;
}
add_filter( 'excerpt_more', 'akella_excerpt_more' );
endif;
if ( ! function_exists( 'akella_categorized_blog' ) ) :
/**
* Determines whether blog/site has more than one category.
*
* Create your own akella_categorized_blog() function to override in a child theme.
*
* @return bool True if there is more than one category, false otherwise.
*/
function akella_categorized_blog() {
if ( false === ( $all_the_cool_cats = get_transient( 'akella_categories' ) ) ) {
// Create an array of all the categories that are attached to posts.
$all_the_cool_cats = get_categories( array(
'fields' => 'ids',
// 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( 'akella_categories', $all_the_cool_cats );
}
if ( $all_the_cool_cats > 1 ) {
// This blog has more than 1 category so akella_categorized_blog should return true.
return true;
} else {
// This blog has only 1 category so akella_categorized_blog should return false.
return false;
}
}
endif;
/**
* Flushes out the transients used in akella_categorized_blog().
*/
function akella_category_transient_flusher() {
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
return;
}
// Like, beat it. Dig?
delete_transient( 'akella_categories' );
}
add_action( 'edit_category', 'akella_category_transient_flusher' );
add_action( 'save_post', 'akella_category_transient_flusher' );
if ( ! function_exists( 'akella_the_custom_logo' ) ) :
/**
* Displays the optional custom logo.
*
* Does nothing if the custom logo is not available.
*/
function akella_the_custom_logo() {
if ( function_exists( 'the_custom_logo' ) ) {
the_custom_logo();
}
}
endif;
if ( ! function_exists( 'akella_post_card' ) ) :
/**
* Prints Post Card HTML.
*
* Create your own akella_post_card() function to override in a child theme.
*
* @param string $classes Post-card classes.
* @param string $thumbnail_size Post-card thumbnail size.
* @param bool True for display post-card caption, false otherwise.
* @return string Prints Post Card HTML.
*/
function akella_post_card( $classes = '', $thumbnail_size = 'null', $content = true, $show_id = true ) {
if ( has_post_thumbnail() && $thumbnail_size !== 'null' ) {
if ( ! $classes ) {
$post_card_classes = 'post-card has-post-thumbnail';
} else {
$post_card_classes = join( ' ', array( 'post-card has-post-thumbnail', $classes ) );
}
} else {
if ( ! $classes ) {
$post_card_classes = 'post-card';
} else {
$post_card_classes = join( ' ', array( 'post-card', $classes ) );
}
} ?>
id="post-" class="">