%4$s'; }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', '' . $time_string . '' ); echo ' ' . $posted_on . ''; // WPCS: XSS OK. } endif; if ( ! function_exists( 'blossom_spa_posted_by' ) ) : /** * Prints HTML with meta information for the current author. */ function blossom_spa_posted_by() { $ed_post_author = get_theme_mod( 'ed_post_author', false ); if( $ed_post_author ) return false; global $post; $author_name = ( is_single() ) ? get_the_author_meta( 'display_name', $post->post_author ) : get_the_author(); $author_url = ( is_single() ) ? get_author_posts_url( get_the_author_meta( 'ID', $post->post_author ) ) : get_author_posts_url( get_the_author_meta( 'ID' ) ); $byline = sprintf( '%s', '' ); if( is_home() || is_archive() || is_search() ) echo '
'; echo ''; if( is_home() || is_archive() || is_search() ) echo '
'; } endif; if( ! function_exists( 'blossom_spa_comment_count' ) ) : /** * Comment Count */ function blossom_spa_comment_count(){ $ed_comments = get_theme_mod( 'ed_comments', false ); if ( ! post_password_required() && ( comments_open() || get_comments_number() ) && !$ed_comments ) { echo ''; comments_popup_link( sprintf( wp_kses( /* translators: %s: post title */ __( 'No Comment on %s', 'blossom-spa' ), array( 'span' => array( 'class' => array(), ), ) ), get_the_title() ) ); echo ''; } } endif; if ( ! function_exists( 'blossom_spa_category' ) ) : /** * Prints categories */ function blossom_spa_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 ) { $categories_list = get_the_category_list( ' ' ); if ( $categories_list ) { echo '' . $categories_list . ''; } }elseif( 'blossom-portfolio' === get_post_type() ) { $term_list = get_the_term_list( get_the_ID(), 'blossom_portfolio_categories' ); if( $term_list ) echo '' . $term_list . ''; } } endif; if ( ! function_exists( 'blossom_spa_tag' ) ) : /** * Prints tags */ function blossom_spa_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', 'blossom-spa' ) . '', '
', '
', $tags_list ); } } } endif; if( ! function_exists( 'blossom_spa_get_posts_list' ) ) : /** * Returns Latest, Related & Popular Posts */ function blossom_spa_get_posts_list( $status ){ global $post; $args = array( 'post_type' => 'post', 'posts_status' => 'publish', 'ignore_sticky_posts' => true ); switch( $status ){ case 'latest': $args['posts_per_page'] = 3; $title = __( 'Recommended Articles', 'blossom-spa' ); $class = ' recent-posts'; $image_size = 'blossom-spa-related'; 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-spa' ) ); $class = ' related-posts'; $image_size = 'blossom-spa-related'; $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; ?>
' . esc_html( $phone_label ) . ''; if( !empty( $phone ) ) echo '

' . esc_html( $phone ) . '

'; ?>
' . esc_html( $email_label ) . ''; if( !empty( $email ) ) echo '

' . sanitize_email( $email ) . '

'; ?>
' . esc_html( $opening_hours_label ) . ''; if( !empty( $opening_hours ) ) echo '

' . esc_html( $opening_hours ) . '

'; ?>
'; echo '
  • ' . esc_html__( 'Click here to add a menu', 'blossom-spa' ) . '
  • '; echo ''; } } endif; if( ! function_exists( 'blossom_spa_secondary_navigation' ) ) : /** * Secondary Navigation */ function blossom_spa_secondary_navigation(){ ?>
    '; echo '
  • ' . esc_html__( 'Click here to add a menu', 'blossom-spa' ) . '
  • '; echo ''; } } endif; if( ! function_exists( 'blossom_spa_breadcrumb' ) ) : /** * Breadcrumbs */ function blossom_spa_breadcrumb() { global $post; $post_page = get_option('page_for_posts'); //The ID of the page that displays posts. $show_front = get_option('show_on_front'); //What to show on the front page $home = get_theme_mod('home_text', __('Home', 'blossom-spa')); // text for the 'Home' link $delimiter = ''; $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_spa_theme_comment' ) ) : /** * Callback function for Comment List * * * @link https://codex.wordpress.org/Function_Reference/wp_list_comments */ function blossom_spa_theme_comment( $comment, $args, $depth ){ if ( 'div' == $args['style'] ) { $tag = 'div'; $add_below = 'comment'; } else { $tag = 'li'; $add_below = 'div-comment'; } ?> < id="comment-">
    $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    ID, '_blossom_spa_sidebar_layout', true ) ){ $sidebar_layout = get_post_meta( $post->ID, '_blossom_spa_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_spa_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 = $class ? 'full-width' : false; } }elseif( '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_spa_get_home_sections' ) ) : /** * Returns Home Sections */ function blossom_spa_get_home_sections(){ $ed_banner = get_theme_mod( 'ed_banner_section', 'static_banner' ); $disable_all_section = get_theme_mod( 'disable_all_section', false ); $sections = array( 'service' => array( 'sidebar' => 'service' ), 'about' => array( 'sidebar' => 'about' ), 'service_two' => array( 'sidebar' => 'service-two' ), 'cta_two' => array( 'sidebar' => 'cta-two' ), 'testimonial' => array( 'sidebar' => 'testimonial' ), 'team' => array( 'sidebar' => 'team' ), 'blog' => array( 'section' => 'blog' ) ); $enabled_section = array(); if( $ed_banner == 'static_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, $k ); }else{ if( get_theme_mod( 'ed_' . $v['section'] . '_section', true ) ) array_push( $enabled_section, $v['section'] ); } } if( $disable_all_section ) { $enabled_section = array(); } return apply_filters( 'blossom_spa_home_sections', $enabled_section ); } endif; if( ! function_exists( 'blossom_spa_escape_text_tags' ) ) : /** * Remove new line tags from string * * @param $text * @return string */ function blossom_spa_escape_text_tags( $text ) { return (string) str_replace( array( "\r", "\n" ), '', strip_tags( $text ) ); } endif; /** * Is Blossom Theme Toolkit active or not */ function blossom_spa_is_bttk_activated(){ return class_exists( 'Blossomthemes_Toolkit' ) ? true : false; } /** * Is BlossomThemes Email Newsletters active or not */ function blossom_spa_is_btnw_activated(){ return class_exists( 'Blossomthemes_Email_Newsletter' ) ? true : false; } /** * Is BlossomThemes Social Feed active or not */ function blossom_spa_is_btif_activated(){ return class_exists( 'Blossomthemes_Instagram_Feed' ) ? true : false; } /** * Query WooCommerce activation */ function blossom_spa_is_woocommerce_activated() { return class_exists( 'woocommerce' ) ? true : false; } /** * Query Jetpack activation */ function blossom_spa_is_jetpack_activated( $gallery = false ){ if( $gallery ){ return ( class_exists( 'jetpack' ) && Jetpack::is_module_active( 'tiled-gallery' ) ) ? true : false; }else{ return class_exists( 'jetpack' ) ? true : false; } } if ( ! function_exists( 'blossom_spa_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 blossom_spa_post_thumbnail() { global $wp_query; $image_size = 'thumbnail'; $sidebar = blossom_spa_sidebar(); if( is_front_page() && is_home() ){ echo ''; $image_size = blossom_spa_blog_layout_image_size(); if( has_post_thumbnail() ){ the_post_thumbnail( $image_size, array( 'itemprop' => 'image' ) ); }else{ blossom_spa_get_fallback_svg( $image_size ); } echo ''; }elseif( is_home() ){ echo ''; $image_size = blossom_spa_blog_layout_image_size(); if( has_post_thumbnail() ){ the_post_thumbnail( $image_size, array( 'itemprop' => 'image' ) ); }else{ blossom_spa_get_fallback_svg( $image_size ); } echo ''; }elseif( is_archive() || is_search() ){ echo ''; $image_size = blossom_spa_blog_layout_image_size(); if( has_post_thumbnail() ){ the_post_thumbnail( $image_size, array( 'itemprop' => 'image' ) ); }else{ blossom_spa_get_fallback_svg( $image_size ); } echo ''; } } endif; if ( ! function_exists( 'blossom_spa_singular_post_thumbnail' ) ) : /** * Blog Layout Image Size */ function blossom_spa_singular_post_thumbnail() { $return = ''; $ed_featured = get_theme_mod( 'ed_featured_image', true ); if( is_singular() ){ $image_size = 'blossom-spa-single'; if( is_single() ){ if( $ed_featured ) $return .= get_the_post_thumbnail_url( '', $image_size ); }elseif( is_page_template( 'templates/blossom-portfolio.php' ) ){ $background_image = esc_url( get_template_directory_uri() .'/images/header-bg.jpg' ); if( has_post_thumbnail() ) : $return .= get_the_post_thumbnail_url( '', $image_size ); else: $return .= $background_image; endif; }else{ $return .= get_the_post_thumbnail_url( '', $image_size ); } } return $return; } endif; if ( ! function_exists( 'blossom_spa_blog_layout_image_size' ) ) : /** * Blog Layout Image Size */ function blossom_spa_blog_layout_image_size() { $sidebar = blossom_spa_sidebar(); $blog_layout = get_theme_mod( 'blog_page_layout', 'list-layout' ); if( $blog_layout == 'list-layout') { $image_size = 'blossom-spa-blog-list'; }elseif( $blog_layout == 'classic-layout' ) { $image_size = ( $sidebar ) ? 'blossom-spa-blog-classic' : 'blossom-spa-blog-classic-full'; }elseif( $blog_layout == 'grid-layout' ){ $image_size = 'blossom-spa-blog-classic'; }else{ $image_size = 'blossom-spa-blog-list'; } return $image_size; } endif; if( ! function_exists( 'blossom_spa_get_image_sizes' ) ) : /** * Get information about available image sizes */ function blossom_spa_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_spa_get_fallback_svg' ) ) : /** * Get Fallback SVG */ function blossom_spa_get_fallback_svg( $post_thumbnail ) { if( ! $post_thumbnail ){ return; } $image_size = blossom_spa_get_image_sizes( $post_thumbnail ); if( $image_size ){ ?>
    tag. * */ do_action( 'wp_body_open' ); } endif; if( ! function_exists( 'blossom_spa_get_page_template_url' ) ) : /** * Returns page template url if not found returns home page url */ function blossom_spa_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;