%4$s'; $on = __( 'Updated on', 'blossom-magazine' ); }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_magazine_posted_by' ) ) : /** * Prints HTML with meta information for the current author. */ function blossom_magazine_posted_by() { global $post; $author_id = $post->post_author; $byline = sprintf( /* translators: %s: post author. */ esc_html_x( '%s', 'post author', 'blossom-magazine' ), '' ); echo ''; } endif; if( ! function_exists( 'blossom_magazine_comment_count' ) ) : /** * Comment Count */ function blossom_magazine_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-magazine' ), array( 'span' => array( 'class' => array(), ), ) ), get_the_title() ) ); echo ''; } } endif; if ( ! function_exists( 'blossom_magazine_category' ) ) : /** * Prints categories */ function blossom_magazine_category(){ // Hide category and tag text for pages. if ( 'post' === get_post_type() ) { /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list( esc_html__( ' ', 'blossom-magazine' ) ); if ( $categories_list ) { echo '' . $categories_list . ''; } } } endif; if ( ! function_exists( 'blossom_magazine_tag' ) ) : /** * Prints tags */ function blossom_magazine_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-magazine' ) . '
', '', '', $tags_list ); } } } endif; if( ! function_exists( 'blossom_magazine_get_posts_list' ) ) : /** * Returns Latest, Related & Popular Posts */ function blossom_magazine_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; $title = __( 'You might also enjoy reading this...', 'blossom-magazine' ); $class = 'additional-post'; $image_size = 'blossom-magazine-featured-cat-two'; 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-magazine' ) ); $class = 'related-posts'; $image_size = 'blossom-magazine-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(); ?>
'; 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-magazine' ) . '
  • '; echo ''; } } endif; if( ! function_exists( 'blossom_magazine_secondary_navigation' ) ) : /** * Secondary Navigation */ function blossom_magazine_secondary_navigation(){ if( current_user_can( 'manage_options' ) || has_nav_menu( 'secondary' ) ) { ?> '; echo ''; echo ''; } } endif; if( ! function_exists( 'blossom_magazine_mobile_navigation' ) ) : /** * Mobile Navigation */ function blossom_magazine_mobile_navigation(){ ?>
    '; $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( blossom_magazine_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_magazine_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-magazine' ), esc_html( get_search_query() ) ) . '' . $after; }elseif( is_day() ){ $depth = 2; echo '' . esc_html( get_the_time( __( 'Y', 'blossom-magazine' ) ) ) . ''; $depth++; echo '' . esc_html( get_the_time( __( 'F', 'blossom-magazine' ) ) ) . ''; $depth++; echo $before . '' . esc_html( get_the_time( __( 'd', 'blossom-magazine' ) ) ) . '' . $after; }elseif( is_month() ){ $depth = 2; echo '' . esc_html( get_the_time( __( 'Y', 'blossom-magazine' ) ) ) . ''; $depth++; echo $before . '' . esc_html( get_the_time( __( 'F', 'blossom-magazine' ) ) ) . '' . $after; }elseif( is_year() ){ $depth = 2; echo $before .''. esc_html( get_the_time( __( 'Y', 'blossom-magazine' ) ) ) .''. $after; }elseif( is_single() && !is_attachment() ){ $depth = 2; if( blossom_magazine_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-magazine'), 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-magazine' ) . '' . $after; } if( get_query_var('paged') ) printf( __( ' (Page %s)', 'blossom-magazine' ), get_query_var('paged') ); echo '
    '; } } endif; if( ! function_exists( 'blossom_magazine_get_banner' ) ) : /** * Prints Banner Section * */ function blossom_magazine_get_banner(){ $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' ); $posts_per_page = get_theme_mod( 'no_of_slides', 5 ); $ed_caption = get_theme_mod( 'slider_caption', true ); $banner_title = get_theme_mod( 'banner_title'); $banner_subtitle = get_theme_mod( 'banner_subtitle' ); $banner_content = get_theme_mod( 'banner_content'); $banner_btn_one = get_theme_mod( 'banner_btn_label' ); $banner_link = get_theme_mod( 'banner_link' ); $btn_one_new_tab = get_theme_mod( 'btn_one_new_tab', false ); $banner_btn_two = get_theme_mod( 'banner_btn_label_two' ); $banner_link_two = get_theme_mod( 'banner_link_two' ); $btn_two_new_tab = get_theme_mod( 'btn_two_new_tab', false ); $banner_caption_layout = get_theme_mod( 'banner_caption_layout', 'left' ); $target_one = $btn_one_new_tab ? 'target=_blank' : ''; $target_two = $btn_two_new_tab ? 'target=_blank' : ''; if( $ed_banner == 'static_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; }else{ $args['post_type'] = 'post'; $args['posts_per_page'] = $posts_per_page; } $qry = new WP_Query( $args ); if( $qry->have_posts() ){ ?> found_posts; $count = $count - ( $count % $image_num ); $index = 1; ?>
    have_posts() ){ $qry->the_post(); $number_of_posts = $qry->post_count - 1; $image_size = blossom_magazine_slider_image_size( $qry, $image_num ); if( $qry->current_post % $image_num == 0 ){ $image_width = ' large-width'; }else{ $image_width = ''; } ?>
    current_post != $number_of_posts ){ echo '
    '; }else{ break; } }elseif( $count == 0 ){ break; } $index++; } wp_reset_postdata(); ?>
    current_post % $image_num == 0 ){ $image_size = 'blossom-magazine-blog-home-first'; } elseif ( ( $qry->current_post % $image_num == 1 ) ) { $image_size = 'blossom-magazine-slider-one'; } elseif ( ( $qry->current_post % $image_num == 4 ) ) { $image_size = 'blossom-magazine-slider-one-a'; } else { $image_size = 'blossom-magazine-related'; } return $image_size; } endif; if( ! function_exists( 'blossom_magazine_theme_comment' ) ) : /** * Callback function for Comment List * * * @link https://codex.wordpress.org/Function_Reference/wp_list_comments */ function blossom_magazine_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-magazine' ), get_comment_author_link() ); ?>
    $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    ID, '_blossom_magazine_sidebar_layout', true ) ){ $sidebar_layout = get_post_meta( $post->ID, '_blossom_magazine_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; } } if( 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_magazine_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_magazine_get_categories' ) ) : /** * Function to list post categories in customizer options */ function blossom_magazine_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-magazine' ); 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_magazine_get_image_sizes' ) ) : /** * Get information about available image sizes */ function blossom_magazine_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_magazine_get_fallback_svg' ) ) : /** * Get Fallback SVG */ function blossom_magazine_get_fallback_svg( $post_thumbnail ) { if( ! $post_thumbnail ){ return; } $image_size = blossom_magazine_get_image_sizes( $post_thumbnail ); $primary_color = get_theme_mod( 'primary_color', '#A60505' ); if( $image_size ){ ?>
    tag. */ do_action( 'wp_body_open' ); } endif; if( ! function_exists( 'blossom_magazine_posts_per_page_count' ) ): /** * Counts the Number of total posts in Archive, Search and Author */ function blossom_magazine_posts_per_page_count(){ global $wp_query; if( is_archive() || is_search() && $wp_query->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_magazine_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-magazine' ), '', absint( $start_post_number ), absint( $end_post_number ), esc_html( number_format_i18n( $wp_query->found_posts ) ), '' ); endif; } } endif; if( ! function_exists( 'blossom_magazine_footer_navigation' ) ) : /** * Footer Navigation */ function blossom_magazine_footer_navigation(){ if( current_user_can( 'manage_options' ) || has_nav_menu( 'footer' ) ) { ?> '; echo '
  • ' . esc_html__( 'Click here to add a menu', 'blossom-magazine' ) . '
  • '; echo ''; } } endif; if( ! function_exists( 'blossom_magazine_get_category_posts' ) ) : /** * Category posts * * @param int $post_no The number of posts according to category section * @param int $cat The ID of category * @param boolean $show_date The value of true or false * @param boolean $image_crop The value of true or false * @param boolean $show_author The value of true or false * @param string $btn_lbl button label */ function blossom_magazine_get_category_posts( $post_no, $cat, $show_date, $image_crop, $show_author, $btn_lbl ){ echo '
    '; ?>

    ' . esc_html( $btn_lbl ) . '
    '; echo ''; } endif; if( ! function_exists( 'blossom_magazine_posts_loop' ) ) : /** * Category posts loop * * @param int $post_no The number of posts according to category section * @param int $single_cat The ID of category * @param boolean $show_date The value of true or false * @param boolean $image_crop The value of true or false * @param boolean $show_author The value of true or false */ function blossom_magazine_posts_loop( $post_no, $single_cat, $show_date, $image_crop, $show_author ){ $query = blossom_magazine_query_calculation( $post_no, $single_cat ); if( $query->have_posts() ) { ?>
    have_posts() ){ $query->the_post(); blossom_magazine_get_single_post_details( $query, $show_date, $image_crop, $show_author ); } wp_reset_postdata(); ?>
    'post', 'posts_per_page' => $post_no ); if( $cat1 ){ $args['tax_query'] = array( array( 'taxonomy' => 'category', 'field' => 'term_id', 'terms' => $cat1, ) ); } $query = new WP_Query($args); return $query; } endif; if( ! function_exists( 'blossom_magazine_get_categories_section' ) ): /** * Categories section * * @param int $cat1 The ID of first category * @param int $cat2 The ID of second category * @param int $cat3 The ID of third category * @param int $post_no The number of posts according to category section * @param int $show_author The value of true or false * @param int $show_date The value of true or false * @param int $image_crop The value of true or false * @param string $btn_lbl The label of section button * */ function blossom_magazine_get_categories_section( $cat1, $cat2, $cat3, $post_no, $show_author, $show_date, $image_crop, $btn_lbl ) { global $cat_variable; $cat_variable = $cat2; ( ! $cat1 ) ? $category_one_class = ' no-category-one' : $category_one_class = ''; ( ! $cat2 ) ? $category_two_class = ' no-category-two' : $category_two_class = ''; ( ! $cat3 ) ? $category_three_class = ' no-category-three' : $category_three_class = ''; ?>
    '; if( $cat1 ) blossom_magazine_get_category_posts( $posts_no, $cat1, $show_date, $image_crop, $show_author, $btn_lbl ); if( $cat2 ) blossom_magazine_get_category_posts( $posts_no, $cat2, $show_date, $image_crop, $show_author, $btn_lbl ); if( $cat3 ) blossom_magazine_get_category_posts( $posts_no, $cat3, $show_date, $image_crop, $show_author, $btn_lbl ); echo ''; } endif; if( ! function_exists( 'blossom_magazine_cat_image_size' ) ): /** * Category image sizes * * @param object $query * @param boolean $image_crop The value of true or false * */ function blossom_magazine_cat_image_size( $query, $image_crop ){ if( $image_crop ){ if( $query->current_post == 0 ){ $image_size = 'blossom-magazine-pop-cat'; }else{ $image_size = 'thumbnail'; } }else{ $image_size = 'full'; } return $image_size; } endif; if( ! function_exists( 'blossom_magazine_get_single_post_details' ) ): /** * * @param object $query * @param boolean $show_date The value of true or false * @param boolean $image_crop The value of true or false * @param boolean $show_author The value of true or false */ function blossom_magazine_get_single_post_details( $query, $show_date, $image_crop, $show_author ){ $current_post_no = $query->current_post; $image_size = blossom_magazine_cat_image_size( $query, $image_crop ); ?>
    'image' ) ); }else{ blossom_magazine_get_fallback_svg( $image_size ); } ?>

    ', '

    ' ); blossom_magazine_cat_entry_footer( $current_post_no, $show_date, $show_author ); ?>
    current_post == 0 ){ $image_size = ( $sidebar ) ? 'blossom-magazine-blog-home-first' : 'blossom-magazine-single-full'; }else{ $image_size = 'blossom-magazine-related'; } if( $ed_crop_blog ) $image_size = 'full'; return $image_size; } endif; if ( ! function_exists( 'blossom_magazine_random_posts_icon' ) ) : /* * Condition to return random posts icon for header */ function blossom_magazine_random_posts_icon(){ $ed_random = get_theme_mod( 'ed_random_posts', false); if ( $ed_random ) { ?>
    'post', 'post_status' => 'publish', 'orderby' => 'rand', 'posts_per_page' => '1', ); $random_post = get_posts( $args ); foreach ($random_post as $p) { $post_id= $p->ID; } $post_url = get_post_permalink( $post_id ); return $post_url; } endif; /** * Is BlossomThemes Email Newsletters active or not */ function blossom_magazine_is_btnw_activated(){ return class_exists( 'Blossomthemes_Email_Newsletter' ) ? true : false; } /** * Is BlossomThemes Social Feed active or not */ function blossom_magazine_is_btif_activated(){ return class_exists( 'Blossomthemes_Instagram_Feed' ) ? true : false; } /** * Query WooCommerce activation */ function blossom_magazine_is_woocommerce_activated() { return class_exists( 'woocommerce' ) ? true : false; } /** * Query Jetpack activation */ function blossom_magazine_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 blossom_magazine_is_classic_editor_activated(){ return class_exists( 'Classic_Editor' ) ? true : false; } /** * Checks if elementor is active or not */ function blossom_magazine_is_elementor_activated(){ return class_exists( 'Elementor\\Plugin' ) ? true : false; }