';
}
/** Link to current page, plus 2 pages in either direction if necessary */
sort( $links );
foreach ( (array) $links as $link ) {
$class = $paged == $link ? ' class="active"' : '';
printf( '
',
esc_url( get_permalink() ),
$time_string
);
}
endif;
if ( ! function_exists( 'ark_entry_taxonomies' ) ) :
/**
* Prints HTML with category and tags for current post.
*
* Create your own ark_entry_taxonomies() function to override in a child theme.
*
* @since Twenty Sixteen 1.0
*/
function ark_entry_taxonomies() {
$categories_list = get_the_category_list( _x( ' ', 'Used between list items, there is a space after the comma.', 'arktheme' ) );
if ( $categories_list && ark_categorized_blog() ) {
printf( '%1$s',
$categories_list
);
}
$tags_list = get_the_tag_list( '', _x( ', ', 'Used between list items, there is a space after the comma.', 'arktheme' ) );
if ( $tags_list ) {
printf( '%1$s %2$s',
_x( 'Tags', 'Used before tag names.', 'arktheme' ),
$tags_list
);
}
}
endif;
if ( ! function_exists( 'ark_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 ark_post_thumbnail() function to override in a child theme.
*
* @since Twenty Sixteen 1.0
*/
function ark_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( esc_html__( 'Continue reading "%s"', 'arktheme' ), get_the_title( get_the_ID() ) )
);
return ' … ' . $link;
}
add_filter( 'excerpt_more', 'ark_excerpt_more' );
endif;
if ( ! function_exists( 'ark_categorized_blog' ) ) :
/**
* Determines whether blog/site has more than one category.
*
* Create your own ark_categorized_blog() function to override in a child theme.
*
* @since Twenty Sixteen 1.0
*
* @return bool True if there is more than one category, false otherwise.
*/
function ark_categorized_blog() {
if ( false === ( $all_the_cool_cats = get_transient( 'ark_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( 'ark_categories', $all_the_cool_cats );
}
if ( $all_the_cool_cats > 1 ) {
// This blog has more than 1 category so ark_categorized_blog should return true.
return true;
} else {
// This blog has only 1 category so ark_categorized_blog should return false.
return false;
}
}
endif;