%4$s'; $on = __( 'Updated on ', 'blossom-floral-pro' ); }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_floral_pro_posted_by' ) ) : /** * Prints HTML with meta information for the current author. */ function blossom_floral_pro_posted_by() { global $post; $author_id = $post->post_author; $byline = sprintf( /* translators: %s: post author. */ esc_html_x( '%s', 'post author', 'blossom-floral-pro' ), '' ); echo ''; } endif; if( ! function_exists( 'blossom_floral_pro_comment_count' ) ) : /** * Comment Count */ function blossom_floral_pro_comment_count( $echo = true ){ if ( $echo && ( ! 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-floral-pro' ), array( 'span' => array( 'class' => array(), ), ) ), get_the_title() ) ); echo ''; }else{ return true; } } endif; if ( ! function_exists( 'blossom_floral_pro_category' ) ) : /** * Prints categories */ function blossom_floral_pro_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( esc_html__( ' ', 'blossom-floral-pro' ) ); if ( $categories_list ) { echo '' . $categories_list . ''; } } } endif; if ( ! function_exists( 'blossom_floral_pro_tag' ) ) : /** * Prints tags */ function blossom_floral_pro_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$sRelated Tags:%2$s %3$s', 'blossom-floral-pro' ) . '', '', '', $tags_list ); } } } endif; if( ! function_exists( 'blossom_floral_pro_estimated_reading_time' ) ) : /** * Reading Time Calculate Function */ function blossom_floral_pro_estimated_reading_time( $content ) { if( !get_theme_mod( 'ed_post_read_calc', false ) ) { $wpm = get_theme_mod( 'read_words_per_minute', 200 ); $clean_content = strip_shortcodes( $content ); $clean_content = strip_tags( $clean_content ); $word_count = str_word_count( $clean_content ); $time = ceil( $word_count / $wpm ); echo '' . absint( $time ) . esc_html__( ' min read', 'blossom-floral-pro' ) . ''; } } endif; if ( ! function_exists( 'blossom_floral_pro_article_meta' )) : /** * Author profile for single post. */ function blossom_floral_pro_article_meta(){ $comment = blossom_floral_pro_comment_count( false ); $ed_author = get_theme_mod( 'ed_post_author', false ); $ed_sharing = get_theme_mod( 'ed_social_sharing', true ); if ( ! $ed_author || $comment || $ed_sharing ) { ?>
'; blossom_floral_pro_like_count(); echo '
'; ?>
'post', 'posts_status' => 'publish', 'ignore_sticky_posts' => true ); switch( $status ){ case 'latest': $args['posts_per_page'] = 6; $title = __( 'You might also enjoy reading this...', 'blossom-floral-pro' ); $class = 'additional-post'; $image_size = 'blossom-floral-related'; break; case 'related': $args['posts_per_page'] = 4; $args['post__not_in'] = array( $post->ID ); $args['orderby'] = 'rand'; $title = get_theme_mod( 'related_post_title', __( 'You may also like...', 'blossom-floral-pro' ) ); $class = 'related-posts'; $image_size = 'blossom-floral-related'; $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(); ?>
'; the_custom_logo(); echo '
'; } if( $site_title || $site_description ) : echo '
'; if( is_front_page() ){ ?>

'; endif; ?>
'fab fa-facebook-f', 'link' => 'https://www.facebook.com/', ), array( 'font' => 'fab fa-twitter', 'link' => 'https://twitter.com/', ), array( 'font' => 'fab fa-youtube', 'link' => 'https://www.youtube.com/', ), array( 'font' => 'fab fa-instagram', 'link' => 'https://www.instagram.com/', ), array( 'font' => 'fab fa-pinterest', 'link' => 'https://www.pinterest.com/', ) ); $social_links = get_theme_mod( 'social_links', $defaults ); $ed_social = get_theme_mod( 'ed_social_links', true ); if( $ed_social && $social_links && $echo ){ ?> '; echo '
  • ' . esc_html__( 'Click here to add a menu', 'blossom-floral-pro' ) . '
  • '; echo ''; } } endif; if( ! function_exists( 'blossom_floral_pro_secondary_navigation' ) ) : /** * Secondary Navigation */ function blossom_floral_pro_secondary_navigation(){ if( current_user_can( 'manage_options' ) || has_nav_menu( 'secondary' ) ) { ?> '; echo ''; echo ''; } } endif; if( ! function_exists( 'blossom_floral_pro_mobile_navigation' ) ) : /** * Mobile Navigation */ function blossom_floral_pro_mobile_navigation(){ $ed_cart = get_theme_mod( 'ed_shopping_cart', true ); ?>
    '; } ?>
    '; $before = ''; // tag before the current crumb $after = ''; // tag after the current crumb if( get_theme_mod( 'ed_breadcrumb', true ) ){ $depth = 1; echo '
    ' . esc_html( $home ) . ''; if( is_home() ){ $depth = 2; echo $before . '' . esc_html( single_post_title( '', false ) ) . '' . $after; }elseif( is_category() ){ $depth = 2; $thisCat = get_category( get_query_var( 'cat' ), false ); if( $show_front === 'page' && $post_page ){ //If static blog post page is set $p = get_post( $post_page ); echo '' . esc_html( $p->post_title ) . ''; $depth++; } if( $thisCat->parent != 0 ){ $parent_categories = get_category_parents( $thisCat->parent, false, ',' ); $parent_categories = explode( ',', $parent_categories ); foreach( $parent_categories as $parent_term ){ $parent_obj = get_term_by( 'name', $parent_term, 'category' ); if( is_object( $parent_obj ) ){ $term_url = get_term_link( $parent_obj->term_id ); $term_name = $parent_obj->name; echo '' . esc_html( $term_name ) . ''; $depth++; } } } echo $before . '' . esc_html( single_cat_title( '', false ) ) . '' . $after; }elseif( is_woocommerce_activated() && ( is_product_category() || is_product_tag() ) ){ //For Woocommerce archive page $depth = 2; $current_term = $GLOBALS['wp_query']->get_queried_object(); if( wc_get_page_id( 'shop' ) ){ //Displaying Shop link in woocommerce archive page $_name = wc_get_page_id( 'shop' ) ? get_the_title( wc_get_page_id( 'shop' ) ) : ''; if ( ! $_name ) { $product_post_type = get_post_type_object( 'product' ); $_name = $product_post_type->labels->singular_name; } echo '' . esc_html( $_name ) . ''; $depth++; } if( is_product_category() ){ $ancestors = get_ancestors( $current_term->term_id, 'product_cat' ); $ancestors = array_reverse( $ancestors ); foreach ( $ancestors as $ancestor ) { $ancestor = get_term( $ancestor, 'product_cat' ); if ( ! is_wp_error( $ancestor ) && $ancestor ) { echo '' . esc_html( $ancestor->name ) . ''; $depth++; } } } echo $before . '' . esc_html( $current_term->name ) .'' . $after; }elseif( is_woocommerce_activated() && is_shop() ){ //Shop Archive page $depth = 2; if( get_option( 'page_on_front' ) == wc_get_page_id( 'shop' ) ){ return; } $_name = wc_get_page_id( 'shop' ) ? get_the_title( wc_get_page_id( 'shop' ) ) : ''; $shop_url = ( wc_get_page_id( 'shop' ) && wc_get_page_id( 'shop' ) > 0 ) ? get_the_permalink( wc_get_page_id( 'shop' ) ) : home_url( '/shop' ); if( ! $_name ){ $product_post_type = get_post_type_object( 'product' ); $_name = $product_post_type->labels->singular_name; } echo $before . '' . esc_html( $_name ) . '' . $after; }elseif( is_tag() ){ $depth = 2; $queried_object = get_queried_object(); echo $before . '' . esc_html( single_tag_title( '', false ) ) . ''. $after; }elseif( is_author() ){ global $author; $depth = 2; $userdata = get_userdata( $author ); echo $before . '' . esc_html( $userdata->display_name ) .'' . $after; }elseif( is_search() ){ $depth = 2; $request_uri = $_SERVER['REQUEST_URI']; echo $before . '' . sprintf( __( 'Search Results for "%s"', 'blossom-floral-pro' ), esc_html( get_search_query() ) ) . '' . $after; }elseif( is_day() ){ $depth = 2; echo '' . esc_html( get_the_time( __( 'Y', 'blossom-floral-pro' ) ) ) . ''; $depth++; echo '' . esc_html( get_the_time( __( 'F', 'blossom-floral-pro' ) ) ) . '' . ''; $depth++; echo $before . '' . esc_html( get_the_time( __( 'd', 'blossom-floral-pro' ) ) ) . '' . $after; }elseif( is_month() ){ $depth = 2; echo '' . esc_html( get_the_time( __( 'Y', 'blossom-floral-pro' ) ) ) . '' . ''; $depth++; echo $before . '' . esc_html( get_the_time( __( 'F', 'blossom-floral-pro' ) ) ) . '' . $after; }elseif( is_year() ){ $depth = 2; echo $before .''. esc_html( get_the_time( __( 'Y', 'blossom-floral-pro' ) ) ) .''. $after; }elseif( is_single() && !is_attachment() ){ $depth = 2; if( is_woocommerce_activated() && 'product' === get_post_type() ){ //For Woocommerce single product if( wc_get_page_id( 'shop' ) ){ //Displaying Shop link in woocommerce archive page $_name = wc_get_page_id( 'shop' ) ? get_the_title( wc_get_page_id( 'shop' ) ) : ''; if ( ! $_name ) { $product_post_type = get_post_type_object( 'product' ); $_name = $product_post_type->labels->singular_name; } echo '' . esc_html( $_name ) . ''; $depth++; } if( $terms = wc_get_product_terms( $post->ID, 'product_cat', array( 'orderby' => 'parent', 'order' => 'DESC' ) ) ){ $main_term = apply_filters( 'woocommerce_breadcrumb_main_term', $terms[0], $terms ); $ancestors = get_ancestors( $main_term->term_id, 'product_cat' ); $ancestors = array_reverse( $ancestors ); foreach ( $ancestors as $ancestor ) { $ancestor = get_term( $ancestor, 'product_cat' ); if ( ! is_wp_error( $ancestor ) && $ancestor ) { echo '' . esc_html( $ancestor->name ) . ''; $depth++; } } echo '' . esc_html( $main_term->name ) . ''; $depth++; } echo $before . '' . esc_html( get_the_title() ) .'' . $after; }elseif( get_post_type() != 'post' ){ $post_type = get_post_type_object( get_post_type() ); if( $post_type->has_archive == true ){// For CPT Archive Link // Add support for a non-standard label of 'archive_title' (special use case). $label = !empty( $post_type->labels->archive_title ) ? $post_type->labels->archive_title : $post_type->labels->name; echo '' . esc_html( $label ) . ''; $depth++; } echo $before . '' . esc_html( get_the_title() ) . '' . $after; }else{ //For Post $cat_object = get_the_category(); $potential_parent = 0; if( $show_front === 'page' && $post_page ){ //If static blog post page is set $p = get_post( $post_page ); echo '' . esc_html( $p->post_title ) . ''; $depth++; } if( $cat_object ){ //Getting category hierarchy if any //Now try to find the deepest term of those that we know of $use_term = key( $cat_object ); foreach( $cat_object as $key => $object ){ //Can't use the next($cat_object) trick since order is unknown if( $object->parent > 0 && ( $potential_parent === 0 || $object->parent === $potential_parent ) ){ $use_term = $key; $potential_parent = $object->term_id; } } $cat = $cat_object[$use_term]; $cats = get_category_parents( $cat, false, ',' ); $cats = explode( ',', $cats ); foreach ( $cats as $cat ) { $cat_obj = get_term_by( 'name', $cat, 'category' ); if( is_object( $cat_obj ) ){ $term_url = get_term_link( $cat_obj->term_id ); $term_name = $cat_obj->name; echo '' . esc_html( $term_name ) . ''; $depth++; } } } echo $before . '' . esc_html( get_the_title() ) . '' . $after; } }elseif( !is_single() && !is_page() && get_post_type() != 'post' && !is_404() ){ //For Custom Post Archive $depth = 2; $post_type = get_post_type_object( get_post_type() ); if( get_query_var('paged') ){ echo '' . esc_html( $post_type->label ) . ''; echo $before . sprintf( __('Page %s', 'blossom-floral-pro'), get_query_var('paged') ) . $after; }else{ echo $before . '' . esc_html( $post_type->label ) . '' . $after; } }elseif( is_attachment() ){ $depth = 2; echo $before . '' . esc_html( get_the_title() ) . '' . $after; }elseif( is_page() && !$post->post_parent ){ $depth = 2; echo $before . '' . esc_html( get_the_title() ) . '' . $after; }elseif( is_page() && $post->post_parent ){ $depth = 2; $parent_id = $post->post_parent; $breadcrumbs = array(); while( $parent_id ){ $current_page = get_post( $parent_id ); $breadcrumbs[] = $current_page->ID; $parent_id = $current_page->post_parent; } $breadcrumbs = array_reverse( $breadcrumbs ); for ( $i = 0; $i < count( $breadcrumbs) ; $i++ ){ echo '' . esc_html( get_the_title( $breadcrumbs[$i] ) ) . ''; $depth++; } echo $before . '' . esc_html( get_the_title() ) . '' . $after; }elseif( is_404() ){ $depth = 2; echo $before . '' . esc_html__( '404 Error - Page Not Found', 'blossom-floral-pro' ) . '' . $after; } if( get_query_var('paged') ) printf( __( ' (Page %s)', 'blossom-floral-pro' ), get_query_var('paged') ); echo '
    '; } } endif; if( ! function_exists( 'blossom_floral_pro_get_banner' ) ) : /** * Prints Banner Section * */ function blossom_floral_pro_get_banner( $slider_layout = 'one' ){ $ed_banner = get_theme_mod( 'ed_banner_section', 'slider_banner' ); $slider_type = get_theme_mod( 'slider_type', 'latest_posts' ); $slider_cat = get_theme_mod( 'slider_cat' ); $slider_pages = get_theme_mod( 'slider_pages' ); $slider_custom = get_theme_mod( 'slider_custom' ); $posts_per_page = get_theme_mod( 'no_of_slides', 3 ); $ed_full_image = get_theme_mod( 'slider_full_image', false ); $ed_caption = get_theme_mod( 'slider_caption', true ); $read_more = get_theme_mod( 'slider_readmore', __( 'Continue Reading', 'blossom-floral-pro' ) ); $banner_title = get_theme_mod( 'banner_title' ); $banner_description = get_theme_mod( 'banner_description' ); $button_one_label = get_theme_mod( 'button_one_label' ); $button_one_link = get_theme_mod( 'button_one_link' ); $button_two_label = get_theme_mod( 'button_two_label' ); $button_two_link = get_theme_mod( 'button_two_link' ); $banner_new_tab = get_theme_mod( 'banner_new_tab', false ); $banner_new_tab_two = get_theme_mod( 'banner_new_tab_two', false ); $banner_caption_layout = get_theme_mod( 'banner_caption_layout', 'left' ); $banner_newsletter = get_theme_mod( 'banner_newsletter' ); $bg_image = get_theme_mod( 'banner_bg_image' ); $target_one = $banner_new_tab ? ' target="_blank"' : ''; $target_two = $banner_new_tab_two ? ' target="_blank"' : ''; if( $slider_layout == 'one' || $slider_layout == 'five' || $slider_layout == 'six' || $slider_layout == 'seven' || $slider_layout == 'eight' ){ $image_size = $ed_full_image ? 'full' : 'blossom-floral-slider'; }elseif( $slider_layout == 'two' ){ $image_size = $ed_full_image ? 'full' : 'blossom-floral-slider-two'; }else{ $image_size = $ed_full_image ? 'full' : 'blossom-floral-slider-three'; } if ( $ed_banner == 'static_banner' ) { $class = 'static-cta'; }elseif( $ed_banner == 'static_nl_banner' ){ $class = 'cta-newsletter-banner'; }else{ $class = ''; } if( ( $ed_banner == 'static_banner' || $ed_banner == 'static_nl_banner' ) && has_custom_header() ){ ?> 'publish', 'ignore_sticky_posts' => true ); if( $slider_type === 'cat' && $slider_cat ){ $args['post_type'] = 'post'; $args['cat'] = $slider_cat; $args['posts_per_page'] = -1; }elseif( $slider_type == 'pages' && $slider_pages ){ $args['post_type'] = 'page'; $args['posts_per_page'] = -1; $args['post__in'] = blossom_floral_pro_get_id_from_page( $slider_pages ); $args['orderby'] = 'post__in'; }else{ $args['post_type'] = 'post'; $args['posts_per_page'] = $posts_per_page; } $qry = new WP_Query( $args ); if( $qry->have_posts() ){ ?> '; ?> < id="comment-">
    comment_approved == '0' ) : ?>
    %s says:', 'blossom-floral-pro' ), get_comment_author_link() ); ?>
    $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    ID, '_blossom_floral_pro_sidebar_layout', true ) ){ $sidebar_layout = get_post_meta( $post->ID, '_blossom_floral_pro_sidebar_layout', true ); }else{ $sidebar_layout = 'default-sidebar'; } /** * Individual post/page sidebar */ if( get_post_meta( $post->ID, '_blossom_floral_pro_sidebar', true ) ){ $single_sidebar = get_post_meta( $post->ID, '_blossom_floral_pro_sidebar', true ); }else{ $single_sidebar = 'default-sidebar'; } if( is_page() ){ 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( $single_sidebar == 'default-sidebar' && is_active_sidebar( $page_sidebar ) ){ if( $class ){ if( ( $sidebar_layout == 'default-sidebar' && $page_layout == 'right-sidebar' ) || ( $sidebar_layout == 'right-sidebar' ) ) $return = 'rightsidebar'; if( ( $sidebar_layout == 'default-sidebar' && $page_layout == 'left-sidebar' ) || ( $sidebar_layout == 'left-sidebar' ) ) $return = 'leftsidebar'; }else{ $return = $page_sidebar; } }elseif( is_active_sidebar( $single_sidebar ) ){ if( $class ){ if( ( $sidebar_layout == 'default-sidebar' && $page_layout == 'right-sidebar' ) || ( $sidebar_layout == 'right-sidebar' ) ) $return = 'rightsidebar'; if( ( $sidebar_layout == 'default-sidebar' && $page_layout == 'left-sidebar' ) || ( $sidebar_layout == 'left-sidebar' ) ) $return = 'leftsidebar'; }else{ $return = $single_sidebar; } }else{ $return = $class ? 'full-width' : false; //Fullwidth } } if( is_single() ){ if( 'product' === get_post_type() ){ //For Product Post Type if( $post_layout == 'no-sidebar' || $post_layout == 'centered' ){ $return = $class ? 'full-width' : false; //Fullwidth }elseif( is_active_sidebar( 'shop-sidebar' ) ){ if( $class ){ if( $post_layout == 'right-sidebar' ) $return = 'rightsidebar'; //With Sidebar if( $post_layout == 'left-sidebar' ) $return = 'leftsidebar'; } }else{ $return = $class ? 'full-width' : false; //Fullwidth } }elseif( 'post' === get_post_type() ){ //For default post type 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( $single_sidebar == 'default-sidebar' && is_active_sidebar( $post_sidebar ) ){ if( $class ){ if( ( $sidebar_layout == 'default-sidebar' && $post_layout == 'right-sidebar' ) || ( $sidebar_layout == 'right-sidebar' ) ) $return = 'rightsidebar'; if( ( $sidebar_layout == 'default-sidebar' && $post_layout == 'left-sidebar' ) || ( $sidebar_layout == 'left-sidebar' ) ) $return = 'leftsidebar'; }else{ $return = $post_sidebar; } }elseif( is_active_sidebar( $single_sidebar ) ){ if( $class ){ if( ( $sidebar_layout == 'default-sidebar' && $post_layout == 'right-sidebar' ) || ( $sidebar_layout == 'right-sidebar' ) ) $return = 'rightsidebar'; if( ( $sidebar_layout == 'default-sidebar' && $post_layout == 'left-sidebar' ) || ( $sidebar_layout == 'left-sidebar' ) ) $return = 'leftsidebar'; }else{ $return = $single_sidebar; } }else{ $return = $class ? 'full-width' : false; //Fullwidth } }else{ //Custom Post Type if( $post_layout == 'no-sidebar' ){ $return = $class ? 'full-width' : false; }elseif( $post_layout == 'centered' ){ $return = $class ? 'full-width centered' : false; }elseif( is_active_sidebar( $post_sidebar ) ){ if( $class ){ if( $post_layout == 'right-sidebar' ) $return = 'rightsidebar'; if( $post_layout == 'left-sidebar' ) $return = 'leftsidebar'; }else{ $return = $post_sidebar; } }else{ $return = $class ? 'full-width' : false; //Fullwidth } } } } if( is_search() ){ $search_sidebar = get_theme_mod( 'search_page_sidebar', 'sidebar' ); $archive_layout = get_theme_mod( 'archive_layout', 'one' ); if( in_array( $archive_layout, $array_one ) ){ $return = $class ? 'full-width centered' : false; }elseif( is_active_sidebar( $search_sidebar ) ){ if( $class ){ if( in_array( $archive_layout, $array_two ) ) $return = 'rightsidebar'; if( in_array( $archive_layout, $array_three ) ) $return = 'leftsidebar'; }else{ $return = $search_sidebar; } }else{ $return = $class ? 'full-width' : false; //Fullwidth } } return $return; } endif; if( ! function_exists( 'blossom_floral_pro_get_posts' ) ) : /** * Fuction to list Custom Post Type */ function blossom_floral_pro_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-floral-pro' ); 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_floral_pro_get_categories' ) ) : /** * Function to list post categories in customizer options */ function blossom_floral_pro_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-floral-pro' ); 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_floral_pro_get_id_from_page' ) ) : /** * Get page ids from page name. */ function blossom_floral_pro_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_floral_pro_get_id_from_post' ) ) : /** * Get post ids from post name. */ function blossom_floral_pro_get_id_from_post( $custom_posts ){ if( $custom_posts ){ $ids = array(); foreach( $custom_posts as $cp ){ if( !empty( $cp['post'] ) ){ $post_ids = get_page_by_title( $cp['post'], OBJECT, 'post' ); $ids[] = $post_ids->ID; } } return $ids; }else{ return false; } } endif; if( ! function_exists( 'blossom_floral_pro_get_patterns' ) ) : /** * Function to list Custom Pattern */ function blossom_floral_pro_get_patterns(){ $patterns = array(); $patterns['nobg'] = get_template_directory_uri() . '/images/patterns_thumb/' . 'nobg.png'; for( $i=0; $i<38; $i++ ){ $patterns['pattern'.$i] = get_template_directory_uri() . '/images/patterns_thumb/' . 'pattern' . $i .'.png'; } for( $j=1; $j<26; $j++ ){ $patterns['hbg'.$j] = get_template_directory_uri() . '/images/patterns_thumb/' . 'hbg' . $j . '.png'; } return $patterns; } endif; if( ! function_exists( 'blossom_floral_pro_get_dynamnic_sidebar' ) ) : /** * Function to list dynamic sidebar */ function blossom_floral_pro_get_dynamnic_sidebar( $nosidebar = false, $sidebar = false, $default = false ){ $sidebar_arr = array(); $sidebars = get_theme_mod( 'sidebar' ); if( $default ) $sidebar_arr['default-sidebar'] = __( 'Default Sidebar', 'blossom-floral-pro' ); if( $sidebar ) $sidebar_arr['sidebar'] = __( 'Sidebar', 'blossom-floral-pro' ); if( $sidebars ){ foreach( $sidebars as $sidebar ){ $id = $sidebar['name'] ? sanitize_title( $sidebar['name'] ) : 'blossom-floral-pro-sidebar-one'; $sidebar_arr[$id] = $sidebar['name']; } } if( $nosidebar ) $sidebar_arr['no-sidebar'] = __( 'No Sidebar', 'blossom-floral-pro' ); return $sidebar_arr; } endif; if( ! function_exists( 'blossom_floral_pro_author_social' ) ) : /** * Author Social Links */ function blossom_floral_pro_author_social(){ $id = get_the_author_meta( 'ID' ); $socials = get_user_meta( $id, '_blossom_floral_pro_user_social_icons', true ); $fonts = array( 'facebook' => 'fab fa-facebook-f', 'twitter' => 'fab fa-twitter', 'instagram' => 'fab fa-instagram', 'snapchat' => 'fab fa-snapchat', 'pinterest' => 'fab fa-pinterest', 'linkedin' => 'fab fa-linkedin-in', 'youtube' => 'fab fa-youtube' ); if( $socials ){ echo ''; } } endif; if( ! function_exists( 'blossom_floral_pro_get_real_ip_address' )): /** * Get the actual ip address */ function blossom_floral_pro_get_real_ip_address(){ if( getenv( 'HTTP_CLIENT_IP' ) ){ $ip = getenv( 'HTTP_CLIENT_IP' ); }elseif( getenv( 'HTTP_X_FORWARDED_FOR' ) ){ $ip = getenv('HTTP_X_FORWARDED_FOR' ); }elseif( getenv( 'HTTP_X_FORWARDED' ) ){ $ip = getenv( 'HTTP_X_FORWARDED' ); }elseif( getenv( 'HTTP_FORWARDED_FOR' ) ){ $ip = getenv( 'HTTP_FORWARDED_FOR' ); }elseif( getenv( 'HTTP_FORWARDED' ) ){ $ip = getenv( 'HTTP_FORWARDED' ); }else{ $ip = $_SERVER['REMOTE_ADDR']; } return $ip; } endif; if( ! function_exists( 'blossom_floral_pro_likes_can' ) ) : /** * Check if the current IP already liked the content or not. */ function blossom_floral_pro_likes_can( $id = 0 ) { // Return early if $id is not set. if( ! $id ){ return false; } $ip_list = ( $ip = get_post_meta( $id, '_blossom_floral_pro_post_like_ip', true ) ) ? $ip : array(); if( ( $ip_list == '' ) || ( is_array( $ip_list ) && ! in_array( blossom_floral_pro_get_real_ip_address(), $ip_list ) ) ){ return true; } return false; } endif; if( ! function_exists( 'blossom_floral_pro_like_count' ) ) : /** * Prints like count of post */ function blossom_floral_pro_like_count(){ $ed_post_like = get_theme_mod( 'ed_post_like', true ); $ed_post_title = get_theme_mod( 'post_like_title', __( 'Like', 'blossom-floral-pro' ) ); if( $ed_post_like ) : global $post; $likes_count = get_post_meta( $post->ID, '_blossom_floral_pro_post_like', true ); $class = ( blossom_floral_pro_likes_can( $post->ID ) ) ? 'like' : 'liked'; $icon = ( blossom_floral_pro_likes_can( $post->ID ) ) ? 'far fa-heart' : 'fas fa-heart'; $add_structure = ( blossom_floral_pro_likes_can( $post->ID ) ) ? '' : ''; $add_structure_end = ( blossom_floral_pro_likes_can( $post->ID ) ) ? '' : ''; echo '
    ' . $add_structure . '' . $add_structure_end . '' . absint( $likes_count ) . '
    '; endif; } endif; if( ! function_exists( 'blossom_floral_pro_single_like_count' ) ) : /** * Prints like count of post */ function blossom_floral_pro_single_like_count(){ $ed_post_like = get_theme_mod( 'ed_post_like', true ); if( $ed_post_like ) : global $post; $class = blossom_floral_pro_likes_can( $post->ID ) ? 'like' : 'liked'; echo '
    ' . blossom_floral_pro_get_like_count( $post->ID ) . '
    '; endif; } endif; if( ! function_exists( 'blossom_floral_pro_get_like_count' ) ) : /** * Return post like count */ function blossom_floral_pro_get_like_count( $post_id ){ $count = get_post_meta( $post_id, '_blossom_floral_pro_post_like', true ); if( $count ){ return $count; }else{ return 0; } } endif; if( ! function_exists( 'blossom_floral_pro_get_ad_block' ) ) : /** * Display AD block * * @param $image - Ad Image file * @param $link - Ad Link * @param $target - Link target * @param $adcode - Adsence Adcode * @param $ed_adcode - Enable/disable Adcode */ function blossom_floral_pro_get_ad_block( $image, $link = false, $target, $adcode = false, $ed_adcode ){ ?> $_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_floral_pro_get_fallback_svg' ) ) : /** * Get Fallback SVG */ function blossom_floral_pro_get_fallback_svg( $post_thumbnail ) { if( ! $post_thumbnail ){ return; } $image_size = blossom_floral_pro_get_image_sizes( $post_thumbnail ); $primary_color = get_theme_mod( 'primary_color', '#F2CAB3' ); if( $image_size ){ ?>
    tag. */ do_action( 'wp_body_open' ); } endif; if( ! function_exists( 'blossom_floral_pro_escape_text_tags' ) ) : /** * Remove new line tags from string * * @param $text * @return string */ function blossom_floral_pro_escape_text_tags( $text ) { return (string) str_replace( array( "\r", "\n" ), '', strip_tags( $text ) ); } endif; if ( ! function_exists( 'blossom_floral_pro_apply_theme_shortcode' ) ) : /** * Footer Shortcode */ function blossom_floral_pro_apply_theme_shortcode( $string ) { if ( empty( $string ) ) { return $string; } $search = array( '[the-year]', '[the-site-link]' ); $replace = array( date_i18n( esc_html__( 'Y', 'blossom-floral-pro' ) ), ''. esc_html( get_bloginfo( 'name', 'display' ) ) . '', ); $string = str_replace( $search, $replace, $string ); return $string; } endif; if( ! function_exists( 'blossom_floral_pro_instagram' ) ) : /** * Instagram Section */ function blossom_floral_pro_instagram( $show = true ){ if( is_btif_activated() ){ $ed_instagram = get_theme_mod( 'ed_instagram', false ); $ed_header = get_theme_mod( 'ed_header_instagram', false ); $ed_footer = get_theme_mod( 'ed_footer_instagram', true ); if( $ed_instagram && $show ) { if( $ed_header ) { echo '
    ' . do_shortcode( '[blossomthemes_instagram_feed]' ) . '
    '; } } elseif( $ed_instagram && !$show ){ if( $ed_footer ) echo ''; } } } endif; /** * Is BlossomThemes Email Newsletters active or not */ function is_btnw_activated(){ return class_exists( 'Blossomthemes_Email_Newsletter' ) ? true : false; } /** * Is Blossom Theme Toolkit active or not */ function is_bttk_activated(){ return class_exists( 'Blossomthemes_Toolkit' ) ? true : false; } /** * Is BlossomThemes Social Feed active or not */ function is_btif_activated(){ return class_exists( 'Blossomthemes_Instagram_Feed' ) ? true : false; } /** * Query WooCommerce activation */ function is_woocommerce_activated() { return class_exists( 'woocommerce' ) ? true : false; } /** * Query Jetpack activation */ function 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; } } /** * Checks if classic editor is active or not */ function is_classic_editor_activated(){ return class_exists( 'Classic_Editor' ) ? true : false; } if( ! function_exists( 'blossom_floral_pro_search' ) ) : /** * Search form Section */ function blossom_floral_pro_search(){ $ed_search = get_theme_mod( 'ed_header_search', true ); if( $ed_search ){ ?>
    '; } ?>
    found_posts > 0 ) { if( $pagination != 'infinite_scroll' && $pagination != 'load_more' ) : $posts_per_page = get_option( 'posts_per_page' ); $paged = ( get_query_var( 'paged' ) ) ? absint( get_query_var( 'paged' ) ) : 1; $start_post_number = 0; $end_post_number = 0; if( $wp_query->found_posts > 0 && !( is_woocommerce_activated() && is_shop() ) ): $start_post_number = 1; if( $wp_query->found_posts < $posts_per_page ) { $end_post_number = $wp_query->found_posts; }else{ $end_post_number = $posts_per_page; } if( $paged > 1 ){ $start_post_number = $posts_per_page * ( $paged - 1 ) + 1; if( $wp_query->found_posts < ( $posts_per_page * $paged ) ) { $end_post_number = $wp_query->found_posts; }else{ $end_post_number = $paged * $posts_per_page; } } printf( esc_html__( '%1$s Showing: %2$s - %3$s of %4$s Articles %5$s', 'blossom-floral-pro' ), '', absint( $start_post_number ), absint( $end_post_number ), esc_html( number_format_i18n( $wp_query->found_posts ) ), '' ); endif; else : printf( esc_html__( '%1$s Showing: %2$s Articles %3$s', 'blossom-floral-pro' ), '', esc_html( number_format_i18n( $wp_query->found_posts ) ), '' ); endif; } } endif; if( ! function_exists( 'blossom_floral_pro_sticky_navigation' ) ) : /** * Sticky Navigation */ function blossom_floral_pro_sticky_navigation(){ $header_layout = get_theme_mod( 'header_layout', 'one' ); if( current_user_can( 'manage_options' ) || has_nav_menu( 'primary' ) ) { ?>
    ID, '_blossom_floral_pro_single_layout', true ); if( $single_meta && $single_meta != 'default' ){ $single_layout_meta = $single_meta; }else{ $single_layout_meta = $single_layout; } return $single_layout_meta; } endif; if( ! function_exists( 'blossom_floral_pro_footer_navigation' ) ) : /** * Footer Navigation */ function blossom_floral_pro_footer_navigation(){ if( current_user_can( 'manage_options' ) || has_nav_menu( 'footer' ) ) { ?> '; echo '
  • ' . esc_html__( 'Click here to add a menu', 'blossom-floral-pro' ) . '
  • '; echo ''; } } endif; /** * Add filter only if function exists */ if (function_exists('DEMO_IMPORTER_PLUS_setup')) { add_filter( 'demo_importer_plus_api_url', function () { return 'https://blossomthemesdemo.com/'; } ); } /** * Add filter for Blossom Floral Pro demo contents */ if (function_exists('DEMO_IMPORTER_PLUS_setup')) { add_filter( 'demo_importer_plus_api_id', function () { return array('316'); } ); }