%4$s'; $on = __('Updated on ', 'blossom-floral'); } 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_posted_by')) : /** * Prints HTML with meta information for the current author. */ function blossom_floral_posted_by() { $byline = sprintf( /* translators: %s: post author. */ esc_html_x('%s', 'post author', 'blossom-floral'), '' ); echo ''; } endif; if (!function_exists('blossom_floral_comment_count')) : /** * Comment Count */ function blossom_floral_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' ), array( 'span' => array( 'class' => array(), ), ) ), get_the_title() ) ); echo ''; }else{ return true; } } endif; if (!function_exists('blossom_floral_category')) : /** * Prints categories */ function blossom_floral_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')); if ($categories_list) { echo '' . wp_kses_post( $categories_list ) . ''; } } } endif; if (!function_exists('blossom_floral_tag')) : /** * Prints tags */ function blossom_floral_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-floral') . '
', '', '', $tags_list); } } } endif; if (!function_exists('blossom_floral_get_posts_list')) : /** * Returns Latest and Related */ function blossom_floral_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'] = 6; $article_title = __('Latest Posts', 'blossom-floral'); $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'; $article_title = get_theme_mod('related_post_title', __('You may also like...', 'blossom-floral')); $class = 'related-posts'; $image_size = 'blossom-floral-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( $article_title ) . ''; ?>
have_posts() ){ $qry->the_post(); ?>
'; // 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 (blossom_floral_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 (blossom_floral_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'), esc_html(get_search_query())) . '' . $after; } elseif (is_day()) { $depth = 2; echo '' . esc_html(get_the_time(__('Y', 'blossom-floral'))) . ''; $depth++; echo '' . esc_html(get_the_time(__('F', 'blossom-floral'))) . ''; $depth++; echo $before . '' . esc_html(get_the_time(__('d', 'blossom-floral'))) . '' . $after; } elseif (is_month()) { $depth = 2; echo '' . esc_html(get_the_time(__('Y', 'blossom-floral'))) . ''; $depth++; echo $before . '' . esc_html(get_the_time(__('F', 'blossom-floral'))) . '' . $after; } elseif (is_year()) { $depth = 2; echo $before . '' . esc_html(get_the_time(__('Y', 'blossom-floral'))) . '' . $after; } elseif (is_single() && !is_attachment()) { $depth = 2; if (blossom_floral_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'), get_query_var('paged')) . $after; //@todo need to check this } 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') . '' . $after; } if (get_query_var('paged')) printf(__(' (Page %s)', 'blossom-floral'), get_query_var('paged')); echo '
'; } } endif; if (!function_exists('blossom_floral_theme_comment')) : /** * Callback function for Comment List * * * @link https://codex.wordpress.org/Function_Reference/wp_list_comments */ function blossom_floral_theme_comment($comment, $args, $depth) { if ('div' == $args['style']) { $tag = 'div'; $add_below = 'comment'; } else { $tag = 'li'; $add_below = 'div-comment'; } ?> < id="comment-">
comment_approved == '0') : ?>
%s says:', 'blossom-floral'), get_comment_author_link()); ?>
$add_below, 'depth' => $depth, 'max_depth' => $args['max_depth']))); ?>
ID, '_blossom_floral_sidebar_layout', true)) { $sidebar_layout = get_post_meta($post->ID, '_blossom_floral_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_floral_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; } } 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_floral_article_meta' )) : /** * Author profile for single post. */ function blossom_floral_article_meta(){ $comment = blossom_floral_comment_count( false ); $ed_author = get_theme_mod( 'ed_post_author', false ); if ( ! $ed_author || $comment ) { ?>
-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'); 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_floral_comment_toggle' ) ): /** * Function toggle comment section position */ function blossom_floral_comment_toggle(){ $comment_postion = get_theme_mod( 'toggle_comments', false ); if ( $comment_postion ) { $priority = 5; }else{ $priority = 45; } return absint( $priority ) ; } endif; if (!function_exists('blossom_floral_get_categories')) : /** * Function to list post categories in customizer options */ function blossom_floral_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'); 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_get_image_sizes')) : /** * Get information about available image sizes */ function blossom_floral_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_floral_get_fallback_svg')) : /** * Get Fallback SVG */ function blossom_floral_get_fallback_svg($post_thumbnail) { if (!$post_thumbnail) { return; } $image_size = blossom_floral_get_image_sizes($post_thumbnail); if ($image_size) { ?>
tag. */ do_action('wp_body_open'); } endif; if (!function_exists('blossom_floral_instagram')) : /** * Instagram Section */ function blossom_floral_instagram($show = true) { $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', false ); $insta_code = get_theme_mod('instagram_shortcode', '[instagram-feed]' ); if( $ed_instagram && $show ) { if( $ed_header ) { echo '
' . do_shortcode( $insta_code ) . '
'; } } elseif( $ed_instagram && !$show ){ if( $ed_footer ) echo ''; } } endif; if( ! function_exists( 'blossom_floral_secondary_navigation' ) ) : /** * Secondary Navigation */ function blossom_floral_secondary_navigation(){ if( current_user_can( 'manage_options' ) || has_nav_menu( 'secondary' ) ) { ?> '; echo ''; echo ''; } } endif; if( ! function_exists( 'blossom_floral_site_branding' ) ) : /** * Site Branding */ function blossom_floral_site_branding( $mobile = false ){ $site_title = get_bloginfo( 'name' ); $site_description = get_bloginfo( 'description', 'display' ); $header_text = get_theme_mod( 'header_text', 1 ); if( has_custom_logo() || $site_title || $site_description || $header_text ) : if( has_custom_logo() && ( $site_title || $site_description ) && $header_text ) { $branding_class = ' has-image-text'; }else{ $branding_class = ''; } ?>
'; the_custom_logo(); echo '
'; } if( $site_title || $site_description ) : echo '
'; if( is_front_page() && !$mobile ){ ?>

'; endif; ?>
'; } ?>
'; echo '
  • ' . esc_html__( 'Click here to add a menu', 'blossom-floral' ) . '
  • '; echo ''; } } endif; if( ! function_exists( 'blossom_floral_mobile_navigation' ) ) : /** * Mobile Navigation */ function blossom_floral_mobile_navigation(){ ?>
    found_posts > 0 ) { $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 && !( blossom_floral_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' ), '', absint( $start_post_number ), absint( $end_post_number ), esc_html( number_format_i18n( $wp_query->found_posts ) ), '' ); endif; } } endif; if( ! function_exists( 'blossom_floral_footer_navigation' ) ) : /** * Footer Navigation */ function blossom_floral_footer_navigation(){ if( current_user_can( 'manage_options' ) || has_nav_menu( 'footer' ) ) { ?> '; echo '
  • ' . esc_html__( 'Click here to add a menu', 'blossom-floral' ) . '
  • '; echo ''; } } endif; if( ! function_exists( 'blossom_floral_estimated_reading_time' ) ) : /** * Reading Time Calculate Function */ function blossom_floral_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' ) . ''; } } endif; /** * Is BlossomThemes Email Newsletters active or not */ function blossom_floral_is_btnw_activated() { return class_exists('Blossomthemes_Email_Newsletter') ? true : false; } /** * Is Blossom Theme Toolkit active or not */ function blossom_floral_is_bttk_activated() { return class_exists('Blossomthemes_Toolkit') ? true : false; } /** * Query WooCommerce activation */ function blossom_floral_is_woocommerce_activated() { return class_exists('woocommerce') ? true : false; }