%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' ), '' ); echo ''; // 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( '
' . esc_html__( '%1$sTags:%2$s %3$s', 'best-shop' ) . '
', '', '', $tags_list ); } } } endif; if( ! function_exists( 'best_shop_get_svg_icons' ) ) : /** * Fuction to list svg */ function best_shop_get_svg_icons(){ $social_media = [ 'facebook', 'twitter', 'digg', 'instagram', 'pinterest', 'telegram', 'getpocket', 'dribbble', 'behance', 'unsplash', 'five-hundred-px', 'linkedin', 'wordpress', 'parler', 'mastodon', 'medium', 'slack', 'codepen', 'reddit', 'twitch', 'tiktok', 'snapchat', 'spotify', 'soundcloud', 'apple_podcast', 'patreon', 'alignable', 'skype', 'github', 'gitlab', 'youtube', 'vimeo', 'dtube', 'vk', 'ok', 'rss', 'facebook_group', 'discord', 'tripadvisor', 'foursquare', 'yelp', 'hacker_news', 'xing', 'flipboard', 'weibo', 'tumblr', 'qq', 'strava', 'flickr' ]; // Initate an empty array $svg_options = array(); $svg_options[''] = __( ' -- Choose -- ', 'best-shop' ); foreach ( $social_media as $svg ) { $svg_options[ $svg ] = esc_html( $svg ); } return $svg_options; } endif; /** * Primary Functions */ if ( ! function_exists( 'best_shop_site_branding' ) ) : /** * Site Branding */ function best_shop_site_branding(){ ?>
'; foreach( $categories_list as $cat_list ){ echo '' . esc_html( $cat_list->name ) . ''; } echo ''; } } 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( '
' . esc_html__( '%1$sTags:%2$s %3$s', 'best-shop' ) . '
', '', '', $tags_list ); } } } endif; if( ! function_exists( 'best_shop_get_image_sizes' ) ) : /** * Get information about available image sizes */ function best_shop_get_image_sizes( $size = '' ) { global $_wp_additional_image_sizes; $sizes = array(); $get_intermediate_image_sizes = get_intermediate_image_sizes(); // Create the full array with sizes and crop info foreach( $get_intermediate_image_sizes as $_size ) { if ( in_array( $_size, array( 'thumbnail', 'medium', 'medium_large', 'large' ) ) ) { $sizes[ $_size ]['width'] = get_option( $_size . '_size_w' ); $sizes[ $_size ]['height'] = get_option( $_size . '_size_h' ); $sizes[ $_size ]['crop'] = (bool) get_option( $_size . '_crop' ); } elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) { $sizes[ $_size ] = array( 'width' => $_wp_additional_image_sizes[ $_size ]['width'], 'height' => $_wp_additional_image_sizes[ $_size ]['height'], 'crop' => $_wp_additional_image_sizes[ $_size ]['crop'] ); } } // Get only 1 size if found if ( $size ) { if( isset( $sizes[ $size ] ) ) { return $sizes[ $size ]; } else { return false; } } return $sizes; } endif; if ( ! function_exists( 'best_shop_get_fallback_svg' ) ) : /** * Get Fallback SVG */ function best_shop_get_fallback_svg( $post_thumbnail ) { if( ! $post_thumbnail ){ return; } $image_size = best_shop_get_image_sizes( $post_thumbnail ); if( $image_size ){ ?>
0 ) { ?>
0 ) { ?>
post_content ); ?>
'post', 'posts_status' => 'publish', 'ignore_sticky_posts' => true ); switch( $status ){ case 'latest': $args['posts_per_page'] = 3; $reltitle = __( 'You might also like', 'best-shop' ); $class = 'recent-posts'; $image_size = 'best_shop_popular_posts'; break; case 'related': $args['posts_per_page'] = 2; $args['post__not_in'] = array( $post->ID ); $args['orderby'] = 'rand'; $reltitle = best_shop_get_setting( 'related_post_title', __( 'You might also like', 'best-shop' ) ); $image_size = 'best_shop_archive'; $cats = get_the_category( $post->ID ); if( $cats ){ $c = array(); foreach( $cats as $cat ){ $c[] = $cat->term_id; } $args['category__in'] = $c; } break; } $qry = new WP_Query( $args ); if( $qry->have_posts() ){ if ( ! is_single() ) echo '
'; if( $reltitle ) echo '

' . esc_html( $reltitle ) . '

'; ?>
have_posts() ){ $qry->the_post(); ?>
'; ?> '; $before = ''; // tag before the current crumb $after = ''; // tag after the current crumb if( best_shop_get_setting( 'enable_breadcrumb', true ) ){ $depth = 1; echo ''; } } endif; if ( ! function_exists( 'best_shop_author_box' ) ) : /** * Author Box for Single Post and Archive Page */ function best_shop_author_box(){ if ( is_single() && get_the_author_meta( 'description' ) ) { ?>

< id="comment-">
'; best_shop_get_footer_copyright(); echo ''; } endif; if( ! function_exists( 'best_shop_get_related_posts' ) ) : /** * Related post */ function best_shop_get_related_posts(){ ?>
array( 'class' => true, 'aria-hidden' => true, 'aria-labelledby' => true, 'role' => true, 'xmlns' => true, 'width' => true, 'height' => true, 'viewbox' => true, // <= Must be lower case! ), 'g' => array( 'fill' => true ), 'title' => array( 'title' => true ), 'path' => array( 'd' => true, 'fill' => true, ), ); return array_merge( $kses_defaults, $svg_args ); } endif; if ( ! function_exists( 'best_shop_social_icons_svg_list' ) ) : /** * Get SVG Image */ function best_shop_social_icons_svg_list( $social ){ if( !$social ){ return; } switch ( $social ) { case 'facebook': return ' '; break; case 'twitter': return ' '; break; case 'instagram': return ' '; break; case 'pinterest': return ' '; break; case 'digg': return ' '; break; case 'telegram': return ' '; break; case 'getpocket': return ' '; break; case 'dribbble': return ' '; break; case 'behance': return ' '; break; case 'unsplash': return ' '; break; case 'five-hundred-px': return ' '; break; case 'linkedin': return ' '; break; case 'WordPress': return ' '; break; case 'parler': return ' '; break; case 'mastodon': return ' '; break; case 'medium': return ' '; break; case 'slack': return ' '; break; case 'codepen': return ' '; break; case 'reddit': return ' '; break; case 'twitch': return ' '; break; case 'tiktok': return ' '; break; case 'snapchat': return ' '; break; case 'spotify': return ' '; break; case 'soundcloud': return ' '; break; case 'apple_podcast': return ' '; break; case 'patreon': return ' '; break; case 'alignable': return ' '; break; case 'skype': return ' '; break; case 'github': return ' '; break; case 'gitlab': return ' '; break; case 'youtube': return ' '; break; case 'vimeo': return ' '; break; case 'dtube': return ' '; break; case 'vk': return ' '; break; case 'ok': return ' '; break; case 'rss': return ' '; break; case 'facebook_group': return ' '; break; case 'discord': return ' '; break; case 'tripadvisor': return ' '; break; case 'foursquare': return ' '; break; case 'yelp': return ' '; break; case 'hacker_news': return ' '; break; case 'xing': return ' '; break; case 'whatsapp': return ' '; break; case 'flipboard': return ' '; break; case 'viber': return ' '; break; case 'line': return ' '; break; case 'weibo': return ' '; break; case 'tumblr': return ' '; break; case 'qq': return ' '; break; case 'wechat': return ' '; break; case 'strava': return ' '; break; case 'flickr': return ' '; break; case 'wordpress': return ''; break; case 'phone': return ' '; break; case 'email': return ' '; break; case 'location': return ' '; break; case 'cart': return ''; break; case 'wishlist': return ''; break; case 'list': return ''; break; case 'sync': return ''; break; case 'my-account': return ''; break; case 'arrow-left': return ''; break; case 'arrow-right': return ''; break; default: # code... break; } } endif; if( ! function_exists( 'best_shop_is_woocommerce_activated' ) ) : /** * Query WooCommerce activation */ function best_shop_is_woocommerce_activated() { return class_exists( 'woocommerce' ) ? true : false; } endif; if( ! function_exists( 'best_shop_is_btnw_activated' ) ) : /** * Is gradientthemes Email Newsletters active or not */ function best_shop_is_btnw_activated(){ return class_exists( 'gradientthemes_Email_Newsletter' ) ? true : false; } endif; /* * News widget functions */ function best_shop_post_grid( $loop, $max_height, $title, $layout, $excerpt, $colums ){ global $post; $i = 1; while( $loop->have_posts() ) : $loop->the_post(); $post_id = get_the_ID(); $thumb_id = get_post_thumbnail_id($post_id); $url = get_the_post_thumbnail_url($post_id, 'full'); if(!$url) { $url = get_template_directory_uri().'/images/empty.png'; } $alt = get_post_meta($thumb_id, '_wp_attachment_image_alt', true); $title = get_the_title(); $content = get_the_excerpt(); $date = get_the_time('M d, Y', $post_id ); $author = get_the_author(); $author_id = $post->post_author ; //compact if($layout == 1) { ?>

0 && $excerpt !==''): ?>

0 && $excerpt !=='' && $layout != 4): ?>

'; foreach($category_object as $c){ $cat = get_category( $c ); echo ''.esc_html($cat->name).' '; break; } echo ''; } class best_shop_cat { public $term_id = ''; public $name = ''; } if ( ! function_exists( 'best_shop_trim_content' ) ) : /** * custom excerpt function * * @since 1.0.0 * @return no of words to display */ function best_shop_trim_content( $length = 40, $post_obj = null ) { global $post; if ( is_null( $post_obj ) ) { $post_obj = $post; } $length = absint( $length ); if ( $length < 1 ) { $length = 40; } $source_content = $post_obj->post_content; if ( ! empty( $post_obj->post_excerpt ) ) { $source_content = $post_obj->post_excerpt; } $source_content = preg_replace( '`\[[^\]]*\]`', '', $source_content ); $trimmed_content = wp_trim_words( $source_content, $length, '...' ); return apply_filters( 'ecommerce_wp_trim_content', $trimmed_content ); } endif; /* * Get Popular taxinomies */ function best_shop_list_popular_taxonomies($taxonomy, $title, $number = 5) { $popular_taxonomies = get_terms(array( 'taxonomy' => $taxonomy, 'number' => absint($number), 'orderby' => 'count', 'order' => 'DESC', 'hide_empty' => true, )); $html = ''; if (isset($popular_taxonomies) && !empty($popular_taxonomies)): $html .= ''; endif; echo wp_kses_post($html); }