%2$s';
$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 . '';
}
endif;
if ( ! function_exists( 'best_shop_posted_by' ) ) :
/**
* Prints HTML with meta information for the current author.
*/
function best_shop_posted_by() {
$byline = sprintf(
/* translators: %s: post author. */
esc_html_x( 'By %s', 'post author', 'best-shop' ),
'' . esc_html( get_the_author() ) . ''
);
echo ' ' . $byline . ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
endif;
if ( ! function_exists( 'best_shop_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.
*/
function best_shop_post_thumbnail() {
if ( post_password_required() || is_attachment() ) {
return;
}
if ( is_singular() ) :
if(has_post_thumbnail()):
?>
'image' ) ); ?>
'image' ) );
}else{
best_shop_get_fallback_svg( 'best_shop_popular_posts' );
} ?>
tag.
*
*/
do_action( 'wp_body_open' );
}
endif;
if( ! function_exists( 'best_shop_get_posts' ) ) :
/**
* Fuction to list Custom Post Type
*/
function best_shop_get_posts( $post_type = 'post', $slug = false ){
$args = array(
'posts_per_page' => -1,
'post_type' => $post_type,
'post_status' => 'publish',
'suppress_filters' => true
);
$posts_array = get_posts( $args );
// Initate an empty array
$post_options = array();
$post_options[''] = __( ' -- Choose -- ', 'best-shop' );
if ( ! empty( $posts_array ) ) {
foreach ( $posts_array as $posts ) {
if( $slug ){
$post_options[ $posts->post_title ] = $posts->post_title;
}else{
$post_options[ $posts->ID ] = $posts->post_title;
}
}
}
return $post_options;
wp_reset_postdata();
}
endif;
if ( ! function_exists( 'best_shop_tag' ) ) :
/**
* Prints tags
*/
function best_shop_tag(){
// Hide category and tag text for pages.
if ( 'post' === get_post_type() ) {
$tags_list = get_the_tag_list( '', ' ' );
if ( $tags_list ) {
/* translators: 1: list of tags. */
printf( '