%4$s'; $on = __( 'updated on ', 'blossom-coach' ); }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_coach_posted_by' ) ) : /** * Prints HTML with meta information for the current author. */ function blossom_coach_posted_by() { $ed_post_author = get_theme_mod( 'ed_post_author', false ); if( $ed_post_author ) return false; $byline = sprintf( /* translators: %s: post author. */ esc_html_x( 'by %s', 'post author', 'blossom-coach' ), '' ); echo ''; } endif; if( ! function_exists( 'blossom_coach_comment_count' ) ) : /** * Comment Count */ function blossom_coach_comment_count(){ if ( ! 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-coach' ), array( 'span' => array( 'class' => array(), ), ) ), get_the_title() ) ); echo ''; } } endif; if ( ! function_exists( 'blossom_coach_category' ) ) : /** * Prints categories */ function blossom_coach_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 . '
'; } } } endif; if ( ! function_exists( 'blossom_coach_tag' ) ) : /** * Prints tags */ function blossom_coach_tag(){ // Hide category and tag text for pages. if( 'post' === get_post_type() ){ $tags_list = get_the_tag_list( ' ' ); if( $tags_list ){ echo '
' . $tags_list . '
'; } } } endif; if( ! function_exists( 'blossom_coach_get_posts_list' ) ) : /** * Returns Latest, Related & Popular Posts */ function blossom_coach_get_posts_list( $status ){ if( ! is_singular( 'post' ) ) return false; global $post; $args = array( 'post_type' => 'post', 'posts_status' => 'publish', 'ignore_sticky_posts' => true, 'posts_per_page' => 6 ); switch( $status ){ case 'latest': $title = __( 'Latest Posts', 'blossom-coach' ); $class = 'latest-articles'; $title_class = 'latest-title'; $image_size = 'blossom-coach-latest'; break; case 'related': $args['post__not_in'] = array( $post->ID ); $args['orderby'] = 'rand'; $title = get_theme_mod( 'related_post_title', __( 'Related Post', 'blossom-coach' ) ); $class = 'related-articles'; $title_class = 'related-title'; $image_size = 'blossom-coach-latest'; $related_tax = get_theme_mod( 'related_taxonomy', 'cat' ); if( $related_tax == 'cat' ){ $cats = get_the_category( $post->ID ); if( $cats ){ $c = array(); foreach( $cats as $cat ){ $c[] = $cat->term_id; } $args['category__in'] = $c; } }elseif( $related_tax == 'tag' ){ $tags = get_the_tags( $post->ID ); if( $tags ){ $t = array(); foreach( $tags as $tag ){ $t[] = $tag->term_id; } $args['tag__in'] = $t; } } break; } $qry = new WP_Query( $args ); if( $qry->have_posts() ){ ?>
' . esc_html( $title ) . ''; ?>
have_posts() ){ $qry->the_post(); ?>
'image' ) ); }else{ blossom_coach_get_fallback_svg( $image_size ); } ?>
', '' ); ?>
'; echo '
  • ' . esc_html__( 'Click here to add a menu', 'blossom-coach' ) . '
  • '; echo ''; } } endif; if( ! function_exists( 'blossom_coach_social_links' ) ) : /** * Social Links */ function blossom_coach_social_links( $echo = true ){ $social_links = get_theme_mod( 'social_links' ); $ed_social = get_theme_mod( 'ed_social_links', true ); if( $ed_social && $social_links && $echo ){ ?> < id="comment-">
    ID, '_blossom_coach_sidebar_layout', true ) ){ $sidebar_layout = get_post_meta( $post->ID, '_blossom_coach_sidebar_layout', true ); }else{ $sidebar_layout = 'default-sidebar'; } if( is_page() ){ if( 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_coach_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( 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_coach_get_posts' ) ) : /** * Fuction to list Custom Post Type */ function blossom_coach_get_posts( $post_type = 'post' ){ $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-coach' ); if ( ! empty( $posts_array ) ) { foreach ( $posts_array as $posts ) { $post_options[ $posts->ID ] = $posts->post_title; } } return $post_options; wp_reset_postdata(); } endif; if( ! function_exists( 'blossom_coach_get_categories' ) ) : /** * Function to list post categories in customizer options */ function blossom_coach_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-coach' ); 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_coach_get_home_sections' ) ) : /** * Returns Home Sections */ function blossom_coach_get_home_sections(){ $ed_banner = get_theme_mod( 'ed_banner_section', 'slider_banner' ); $sections = array( 'client' => array( 'sidebar' => 'client' ), 'about' => array( 'sidebar' => 'about' ), 'cta' => array( 'sidebar' => 'cta' ), 'testimonial' => array( 'sidebar' => 'testimonial' ), 'service' => array( 'sidebar' => 'service' ), 'wheel-of-life' => array( 'section' => 'wheel-of-life' ), 'blog' => array( 'section' => 'blog' ), 'simple-cta' => array( 'sidebar' => 'simple-cta' ), 'contact' => array( 'sidebar' => 'contact' ), ); $enabled_section = array(); if( $ed_banner == 'static_nl_banner' || $ed_banner == 'slider_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', true ) ) array_push( $enabled_section, $v['section'] ); } } return apply_filters( 'blossom_coach_home_sections', $enabled_section ); } endif; if( ! function_exists( 'blossom_coach_escape_text_tags' ) ) : /** * Remove new line tags from string * * @param $text * @return string */ function blossom_coach_escape_text_tags( $text ) { return (string) str_replace( array( "\r", "\n" ), '', strip_tags( $text ) ); } endif; /** * Is Blossom Theme Toolkit active or not */ function blossom_coach_is_bttk_activated(){ return class_exists( 'Blossomthemes_Toolkit' ) ? true : false; } /** * Is BlossomThemes Email Newsletters active or not */ function blossom_coach_is_btnw_activated(){ return class_exists( 'Blossomthemes_Email_Newsletter' ) ? true : false; } /** * Is BlossomThemes Social Feed active or not */ function blossom_coach_is_btif_activated(){ return class_exists( 'Blossomthemes_Instagram_Feed' ) ? true : false; } /** * Query WooCommerce activation */ function blossom_coach_is_woocommerce_activated() { return class_exists( 'woocommerce' ) ? true : false; } /** * Check if Contact Form 7 Plugin is installed */ function blossom_coach_is_cf7_activated(){ return class_exists( 'WPCF7' ) ? true : false; } /** * Is Wheel of life activated */ function blossom_coach_is_wheel_of_life_activated() { return class_exists( 'WheelOfLife\Wheel_Of_Life' ) ? true : false; } if( ! function_exists( 'blossom_coach_get_image_sizes' ) ) : /** * Get information about available image sizes */ function blossom_coach_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_coach_get_fallback_svg' ) ) : /** * Get Fallback SVG */ function blossom_coach_get_fallback_svg( $post_thumbnail ) { if( ! $post_thumbnail ){ return; } $image_size = blossom_coach_get_image_sizes( $post_thumbnail ); if( $image_size ){ ?>
    tag. * */ do_action( 'wp_body_open' ); } endif; if( ! function_exists( 'blossom_coach_breadcrumb' ) ) : /** * Breadcrumbs */ function blossom_coach_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-coach' ) ); // 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_coach_get_page_template_url' ) ) : /** * Returns page template url if not found returns home page url */ function blossom_coach_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;