%4$s'; $on = __( 'updated on ', 'blossom-shop' ); }else{ $time_string = ''; } }else{ $time_string = ''; } $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 = sprintf( '%1$s %2$s', esc_html( $on ), '' . $time_string . '' ); echo '' . $posted_on . ''; // WPCS: XSS OK. } endif; if ( ! function_exists( 'blossom_shop_posted_by' ) ) : /** * Prints HTML with meta information for the current author. */ function blossom_shop_posted_by() { $byline = sprintf( /* translators: %s: post author. */ esc_html_x( 'by %s', 'post author', 'blossom-shop' ), '' ); echo ''; } endif; if( ! function_exists( 'blossom_shop_comment_count' ) ) : /** * Comment Count */ function blossom_shop_comment_count(){ $ed_comments = get_theme_mod( 'ed_comments', true ); if ( $ed_comments && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { echo ''; comments_popup_link( sprintf( wp_kses( /* translators: %s: post title */ __( 'Leave a Comment on %s', 'blossom-shop' ), array( 'span' => array( 'class' => array(), ), ) ), get_the_title() ) ); echo ''; } } endif; if ( ! function_exists( 'blossom_shop_category' ) ) : /** * Prints categories */ function blossom_shop_category(){ $ed_cat_single = get_theme_mod( 'ed_category', false ); // Hide category and tag text for pages. if ( 'post' === get_post_type() && !$ed_cat_single ) { /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list( ' ' ); if ( $categories_list ) { echo '' . $categories_list . ''; } } } endif; if ( ! function_exists( 'blossom_shop_category_slider' ) ) : /** * Prints categories */ function blossom_shop_category_slider(){ if( 'post' === get_post_type() ){ /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list( ' ' ); if ( $categories_list ) { echo ''; } } } endif; if ( ! function_exists( 'blossom_shop_tag' ) ) : /** * Prints tags */ function blossom_shop_tag(){ // 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( '' ); if ( $tags_list ) { /* translators: 1: list of tags. */ printf( '
' . esc_html__( '%1$sTAGS:%2$s %3$s', 'blossom-shop' ) . '
', '', '', $tags_list ); } } } endif; if( ! function_exists( 'blossom_shop_get_posts_list' ) ) : /** * Returns Latest, Related & Popular Posts */ function blossom_shop_get_posts_list( $status ){ global $post; $args = array( 'post_type' => 'post', 'ignore_sticky_posts' => true ); switch( $status ){ case 'latest': $args['posts_per_page'] = 3; $title = __( 'Latest Posts', 'blossom-shop' ); $class = 'additional-post'; $image_size = 'blossom-shop-blog-list'; $readmore = get_theme_mod( 'read_more_text', __( 'READ MORE', 'blossom-shop' ) ); break; case 'related': $args['posts_per_page'] = 3; $args['post__not_in'] = array( $post->ID ); $args['orderby'] = 'rand'; $title = get_theme_mod( 'related_post_title', __( 'Recommended Articles', 'blossom-shop' ) ); $readmore = get_theme_mod( 'read_more_text', __( 'READ MORE', 'blossom-shop' ) ); $class = 'additional-post'; $image_size = 'blossom-shop-blog-list'; $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() ){ ?>
' . esc_html( $title ) . ''; ?>
have_posts() ){ $qry->the_post(); ?>
'; if( is_front_page() ){ ?>

'; endif; ?>
'primary' ) ); }else{ ?> '; echo '
  • ' . esc_html__( 'Click here to add a menu', 'blossom-shop' ) . '
  • '; echo ''; } } endif; if( ! function_exists( 'blossom_shop_secondary_navigation' ) ) : /** * Secondary Navigation */ function blossom_shop_secondary_navigation(){ if( current_user_can( 'manage_options' ) || has_nav_menu( 'secondary' ) ) { ?> '; echo '
  • ' . esc_html__( 'Click here to add a menu', 'blossom-shop' ) . '
  • '; echo ''; } } endif; if( ! function_exists( 'blossom_shop_user_block' ) ) : /** * Header User Block */ function blossom_shop_user_block(){ $ed_user = get_theme_mod( 'ed_user_login', true ); if( $ed_user && blossom_shop_is_woocommerce_activated() && wc_get_page_id( 'myaccount' ) ) : if ( is_user_logged_in() ) { $current_user = wp_get_current_user(); $display_text = $current_user->display_name; } else { $display_text = __( 'Login', 'blossom-shop' ); if ( get_option( 'users_can_register' ) ) { $display_text = __( 'Login/Register', 'blossom-shop' ); } } ?>
  • < id="comment-">
    comment_approved == '0' ) : ?>


    $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    '; $before = ''; // tag before the current crumb $after = ''; // tag after the current crumb if( get_theme_mod( 'ed_breadcrumb', true ) ){ $depth = 1; echo ''; } } endif; if( ! function_exists( 'blossom_shop_sidebar' ) ) : /** * Return sidebar layouts for pages/posts */ function blossom_shop_sidebar( $class = false ){ global $post; $return = false; $page_layout = get_theme_mod( 'page_sidebar_layout', 'right-sidebar' ); //Default Layout Style for Pages $post_layout = get_theme_mod( 'post_sidebar_layout', 'right-sidebar' ); //Default Layout Style for Posts $layout = get_theme_mod( 'layout_style', 'right-sidebar' ); //Default Layout Style for Styling Settings if( is_singular( array( 'page', 'post' ) ) ){ if( get_post_meta( $post->ID, '_blossom_shop_sidebar_layout', true ) ){ $sidebar_layout = get_post_meta( $post->ID, '_blossom_shop_sidebar_layout', true ); }else{ $sidebar_layout = 'default-sidebar'; } if( is_page() ){ if( is_page_template( 'templates/blossom-portfolio.php' ) ) { $return = $class ? 'full-width' : false; }elseif( is_active_sidebar( 'sidebar' ) ){ if( $sidebar_layout == 'no-sidebar' || ( $sidebar_layout == 'default-sidebar' && $page_layout == 'no-sidebar' ) ){ $return = $class ? 'full-width' : false; }elseif( $sidebar_layout == 'centered' || ( $sidebar_layout == 'default-sidebar' && $page_layout == 'centered' ) ){ $return = $class ? 'full-width centered' : false; }elseif( ( $sidebar_layout == 'default-sidebar' && $page_layout == 'right-sidebar' ) || ( $sidebar_layout == 'right-sidebar' ) ){ $return = $class ? 'rightsidebar' : 'sidebar'; }elseif( ( $sidebar_layout == 'default-sidebar' && $page_layout == 'left-sidebar' ) || ( $sidebar_layout == 'left-sidebar' ) ){ $return = $class ? 'leftsidebar' : 'sidebar'; } }else{ $return = $class ? 'full-width' : false; } }elseif( is_single() ){ if( is_active_sidebar( 'sidebar' ) ){ if( $sidebar_layout == 'no-sidebar' || ( $sidebar_layout == 'default-sidebar' && $post_layout == 'no-sidebar' ) ){ $return = $class ? 'full-width' : false; }elseif( $sidebar_layout == 'centered' || ( $sidebar_layout == 'default-sidebar' && $post_layout == 'centered' ) ){ $return = $class ? 'full-width centered' : false; }elseif( ( $sidebar_layout == 'default-sidebar' && $post_layout == 'right-sidebar' ) || ( $sidebar_layout == 'right-sidebar' ) ){ $return = $class ? 'rightsidebar' : 'sidebar'; }elseif( ( $sidebar_layout == 'default-sidebar' && $post_layout == 'left-sidebar' ) || ( $sidebar_layout == 'left-sidebar' ) ){ $return = $class ? 'leftsidebar' : 'sidebar'; } }else{ $return = $class ? 'full-width' : false; } } }elseif( blossom_shop_is_woocommerce_activated() && ( is_shop() || is_product_category() || is_product_tag() || get_post_type() == 'product' ) ){ if( $layout == 'no-sidebar' ){ $return = $class ? 'full-width' : false; }elseif( is_active_sidebar( 'shop-sidebar' ) ){ if( $class ){ if( $layout == 'right-sidebar' ) $return = 'rightsidebar'; //With Sidebar if( $layout == 'left-sidebar' ) $return = 'leftsidebar'; }else{ $return = 'shop-sidebar'; } }else{ $return = $class ? 'full-width' : false; } }elseif( is_singular( 'blossom-portfolio' ) && 'blossom-portfolio' === get_post_type() ){ //For Portfolio Post Type $return = $class ? 'full-width' : false; //Fullwidth }elseif( is_404() ){ $return = $class ? 'full-width' : false; }else{ if( $layout == 'no-sidebar' ){ $return = $class ? 'full-width' : false; }elseif( is_active_sidebar( 'sidebar' ) ){ if( $class ){ if( $layout == 'right-sidebar' ) $return = 'rightsidebar'; //With Sidebar if( $layout == 'left-sidebar' ) $return = 'leftsidebar'; }else{ $return = 'sidebar'; } }else{ $return = $class ? 'full-width' : false; } } return $return; } endif; if( ! function_exists( 'blossom_shop_get_posts' ) ) : /** * Fuction to list Custom Post Type */ function blossom_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 -- ', 'blossom-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( 'blossom_shop_get_categories' ) ) : /** * Function to list post categories in customizer options */ function blossom_shop_get_categories( $select = true, $taxonomy = 'category', $slug = false ){ /* Option list of all categories */ $categories = array(); $args = array( 'hide_empty' => false, 'taxonomy' => $taxonomy ); $catlists = get_terms( $args ); if( $select ) $categories[''] = __( 'Choose Category', 'blossom-shop' ); foreach( $catlists as $category ){ if( $slug ){ $categories[$category->slug] = $category->name; }else{ $categories[$category->term_id] = $category->name; } } return $categories; } endif; if( ! function_exists( 'blossom_shop_get_id_from_page' ) ) : /** * Get page ids from page name. */ function blossom_shop_get_id_from_page( $slider_pages ){ if( $slider_pages ){ $ids = array(); foreach( $slider_pages as $p ){ if( !empty( $p['page'] ) ){ $page_ids = get_page_by_title( $p['page'] ); $ids[] = $page_ids->ID; } } return $ids; }else{ return false; } } endif; if( ! function_exists( 'blossom_shop_get_home_sections' ) ) : /** * Returns Home Sections */ function blossom_shop_get_home_sections(){ $ed_banner = get_theme_mod( 'ed_banner_section', 'slider_banner' ); $home_sections = array( 'service', 'recent_product', 'featured', 'cat_one', 'about', 'testimonial', 'cta', 'blog', 'client' ); $sections = array( 'service' => array( 'sidebar' => 'service' ), 'recent_product' => array( 'section' => 'recent_product' ), 'featured' => array( 'section' => 'featured' ), 'cat_one' => array( 'section' => 'cat_one' ), 'about' => array( 'sidebar' => 'about' ), 'testimonial' => array( 'sidebar' => 'testimonial' ), 'cta' => array( 'sidebar' => 'cta' ), 'blog' => array( 'section' => 'blog' ), 'client' => array( 'sidebar' => 'client' ), ); $enabled_section = array(); if( $ed_banner == 'static_banner' || $ed_banner == 'slider_banner' || $ed_banner == 'static_nl_banner' ) array_push( $enabled_section, 'banner' ); foreach( $sections as $k => $v ){ if( array_key_exists( 'sidebar', $v ) ){ if( is_active_sidebar( $v['sidebar'] ) ) array_push( $enabled_section, $v['sidebar'] ); }else{ if( get_theme_mod( 'ed_' . $v['section'] . '_section', false ) ) array_push( $enabled_section, $v['section'] ); } } return apply_filters( 'blossom_shop_home_sections', $enabled_section ); } endif; if( ! function_exists( 'blossom_shop_get_image_sizes' ) ) : /** * Get information about available image sizes */ function blossom_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( 'blossom_shop_get_fallback_svg' ) ) : /** * Get Fallback SVG */ function blossom_shop_get_fallback_svg( $post_thumbnail ) { if( ! $post_thumbnail ){ return; } $image_size = blossom_shop_get_image_sizes( $post_thumbnail ); if( $image_size ){ ?>
    <?php esc_attr_e( 'payment-image', 'blossom-shop' ) ?>
    tag. * */ do_action( 'wp_body_open' ); } endif; if( ! function_exists( 'blossom_shop_get_page_template_url' ) ) : /** * Returns page template url if not found returns home page url */ function blossom_shop_get_page_template_url( $page_template ){ $args = array( 'meta_key' => '_wp_page_template', 'meta_value' => $page_template, 'post_type' => 'page', 'fields' => 'ids', ); $posts_array = get_posts( $args ); $url = ( $posts_array ) ? get_permalink( $posts_array[0] ) : get_permalink( get_option( 'page_on_front' ) ); return $url; } endif; if ( ! function_exists( 'blossom_shop_featured_options' ) ) : /** * @return array Content type options */ function blossom_shop_featured_options() { $featured_options = array( 'feat_page' => __( 'Page', 'blossom-shop' ), ); if ( blossom_shop_is_woocommerce_activated() ) { $featured_options = array_merge( $featured_options, array( 'feat_cat' => __( 'Product Category','blossom-shop' ) ) ); } $output = apply_filters( 'blossom_shop_featured_options', $featured_options ); return $output; } endif;