';
endif;
elseif ( get_post_gallery() ) :
echo '';
else:
do_action('shopstore_posts_formats_thumbnail');
endif;
}
endif;
add_action( 'shopstore_posts_formats_gallery', 'shopstore_posts_formats_gallery' );
if ( ! function_exists( 'shopstore_posts_blog_media' ) ) :
/**
* Post shopstore_posts_blog_media
*
* @since 1.0.0
*/
function shopstore_posts_blog_media() {
$formats = get_post_format(get_the_ID());
switch ( $formats ) {
default:
do_action('shopstore_posts_formats_thumbnail');
break;
case 'gallery':
do_action('shopstore_posts_formats_gallery');
break;
case 'audio':
do_action('shopstore_posts_formats_audio');
break;
case 'video':
do_action('shopstore_posts_formats_video');
break;
}
}
endif;
add_action( 'shopstore_posts_blog_media', 'shopstore_posts_blog_media' );
if ( ! function_exists( 'shopstore_posted_meta' ) ) :
/**
* Prints HTML with meta information for the current post-date/time.
*/
function shopstore_posted_meta() {
$time_string = '';
$time_string = sprintf( $time_string,
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() )
);
$posted_on = '' . $time_string . '';
$byline = sprintf(
/* translators: %s: post author */
__( 'by %s','shopstore' ),
'' . esc_html( get_the_author() ) . ''
);
echo '
' . $posted_on . '
' . $byline . '
'; // WPCS: XSS OK.
// Hide category and tag text for pages.
if ( 'post' === get_post_type() ) {
/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list( esc_html__( ', ', 'shopstore' ) );
if ( $categories_list && shopstore_categorized_blog() ) {
printf( '
';
/* translators: %s: post title */
comments_popup_link( sprintf( wp_kses( __( 'Leave a Comment on %s', 'shopstore' ), array( 'span' => array( 'class' => array() ) ) ), get_the_title() ) );
echo '
';
}
edit_post_link(
sprintf(
/* translators: %s: Name of current post */
esc_html__( 'Edit %s', 'shopstore' ),
the_title( '
"', '"
', false )
),
'
',
'
'
);
}
endif;
if ( ! function_exists( 'shopstore_categorized_blog' ) ) :
/**
* Returns true if a blog has more than 1 category.
*
* @return bool
*/
function shopstore_categorized_blog() {
if ( false === ( $all_the_cool_cats = get_transient( 'shopstore_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( 'shopstore_categories', $all_the_cool_cats );
}
if ( $all_the_cool_cats > 1 ) {
// This blog has more than 1 category so shopstore_categorized_blog should return true.
return true;
} else {
// This blog has only 1 category so shopstore_categorized_blog should return false.
return false;
}
}
endif;
if ( ! function_exists( 'shopstore_entry_footer' ) ) :
/**
* Prints HTML with meta information for the categories, tags and comments.
*/
function shopstore_entry_footer() {
// Hide category and tag text for pages.
if ( 'post' === get_post_type() ) {
/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list( '', esc_html_x( ' ', 'list item separator', 'shopstore' ) );
if ( $tags_list ) {
echo $tags_list;
}
}
edit_post_link(
sprintf(
wp_kses(
/* translators: %s: Name of current post. Only visible to screen readers */
__( 'Edit %s', 'shopstore' ),
array(
'span' => array(
'class' => array(),
),
)
),
get_the_title()
),
'',
''
);
}
endif;
if ( ! function_exists( 'shopstore_single_post_navigation' ) ) :
/**
* Post Single Posts Navigation
*
* @since 1.0.0
*/
function shopstore_single_post_navigation( ) {
echo '