%4$s'; $on = __( 'updated on ', 'blossom-recipe' ); }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() ) ); if( is_single() ) { $posted_on = sprintf( '%1$s %2$s', esc_html( $on ), '' . $time_string . '' ); }else{ $posted_on = sprintf( '%1$s', '' . $time_string . '' ); } echo '' . $posted_on . ''; // WPCS: XSS OK. } endif; if ( ! function_exists( 'blossom_recipe_posted_by' ) ) : /** * Prints HTML with meta information for the current author. */ function blossom_recipe_posted_by() { $ed_post_author = get_theme_mod( 'ed_post_author', false ); if( $ed_post_author ) return false; $byline = sprintf( '%s', '' ); echo ''; } endif; if( ! function_exists( 'blossom_recipe_comment_count' ) ) : /** * Comment Count */ function blossom_recipe_comment_count(){ $ed_comments = get_theme_mod( 'ed_comments', true ); if ( ! post_password_required() && ( comments_open() || get_comments_number() ) && $ed_comments ) { echo ''; comments_popup_link( sprintf( wp_kses( /* translators: %s: post title */ __( 'Leave a Comment on %s', 'blossom-recipe' ), array( 'span' => array( 'class' => array(), ), ) ), get_the_title() ) ); echo ''; } } endif; if ( ! function_exists( 'blossom_recipe_category' ) ) : /** * Prints categories */ function blossom_recipe_category(){ $ed_cat_single = get_theme_mod( 'ed_category', false ); // Hide category and tag text for pages. if ( 'post' === get_post_type() && !$ed_cat_single ) { $categories_list = get_the_category_list( ' ' ); if ( $categories_list ) { echo '' . $categories_list . ''; } }elseif( blossom_recipe_is_brm_activated() && 'blossom-recipe' === get_post_type() ){ $categories_list = get_the_term_list( '', 'recipe-category' ); if ( $categories_list ) { echo '' . $categories_list . ''; } } } endif; if ( ! function_exists( 'blossom_recipe_tag' ) ) : /** * Prints tags */ function blossom_recipe_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-recipe' ) . '
', '', '', $tags_list ); } } } endif; if( ! function_exists( 'blossom_recipe_get_posts_list' ) ) : /** * Returns Latest, Related & Popular Posts */ function blossom_recipe_get_posts_list( $status ){ global $post; $sidebar = blossom_recipe_sidebar( true ); $args = array( 'posts_status' => 'publish', 'ignore_sticky_posts' => true ); switch( $status ){ case 'latest': $args['post_type'] = 'post'; $args['posts_per_page'] = 4; $title = __( 'Latest Posts', 'blossom-recipe' ); $class = 'latest'; $image_size = 'blossom-recipe-slider'; break; case 'related': $args['post_type'] = 'post'; $args['posts_per_page'] = ( $sidebar == 'full-width' ) ? 4 : 6; $args['post__not_in'] = array( $post->ID ); $args['orderby'] = 'rand'; $title = get_theme_mod( 'related_post_title', __( 'You may also like...', 'blossom-recipe' ) ); $class = 'related'; $image_size = 'blossom-recipe-slider'; $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(); ?>
'image' ) ); }else{ blossom_recipe_get_fallback_svg( $image_size ); } ?>
', '' ); ?>
'; if( is_front_page() ){ ?>

'; endif; ?>
'; echo '
  • ' . esc_html__( 'Click here to add a menu', 'blossom-recipe' ) . '
  • '; echo ''; } } endif; if( ! function_exists( 'blossom_recipe_theme_comment' ) ) : /** * Callback function for Comment List * * * @link https://codex.wordpress.org/Function_Reference/wp_list_comments */ function blossom_recipe_theme_comment( $comment, $args, $depth ){ if ( 'div' == $args['style'] ) { $tag = 'div'; $add_below = 'comment'; } else { $tag = 'li'; $add_below = 'div-comment'; } ?> < id="comment-">
    %s says:', 'blossom-recipe' ), get_comment_author_link() ); ?>
    comment_approved == '0' ) : ?>


    $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    ID, '_blossom_recipe_sidebar_layout', true ) ){ $sidebar_layout = get_post_meta( $post->ID, '_blossom_recipe_sidebar_layout', true ); }else{ $sidebar_layout = 'default-sidebar'; } if( is_page() ){ $template = array( 'templates/template-recipe-category.php', 'templates/template-recipe-cooking-method.php', 'templates/template-recipe-cuisine.php', 'templates/blossom-portfolio.php' ); $dr_template = array( 'templates/pages/recipe-courses.php', 'templates/pages/recipe-cuisines.php', 'templates/pages/recipe-cooking-methods.php', 'templates/pages/recipe-keys.php', 'templates/pages/recipe-tags.php' ); if( is_page_template( $template ) ){ $return = $class ? 'full-width' : false; }elseif( is_page_template( $dr_template ) ){ if( $page_layout == 'no-sidebar' ){ $return = $class ? 'full-width' : false; }elseif( $page_layout == 'centered' ){ $return = $class ? 'full-width centered' : false; }elseif( is_active_sidebar( 'delicious-recipe-sidebar' ) ){ if( $class ){ if( $page_layout == 'right-sidebar' ) $return = 'rightsidebar'; //With Sidebar if( $page_layout == 'left-sidebar' ) $return = 'leftsidebar'; }else{ $return = 'delicious-recipe-sidebar'; } }else{ $return = $class ? 'full-width' : false; } }elseif( is_active_sidebar( 'sidebar' ) ){ if( $sidebar_layout == 'no-sidebar' || ( $sidebar_layout == 'default-sidebar' && $page_layout == 'no-sidebar' ) ){ $return = $class ? 'full-width' : false; }elseif( $sidebar_layout == 'centered' || ( $sidebar_layout == 'default-sidebar' && $page_layout == 'centered' ) ){ $return = $class ? 'full-width centered' : false; }elseif( ( $sidebar_layout == 'default-sidebar' && $page_layout == 'right-sidebar' ) || ( $sidebar_layout == 'right-sidebar' ) ){ $return = $class ? 'rightsidebar' : 'sidebar'; }elseif( ( $sidebar_layout == 'default-sidebar' && $page_layout == 'left-sidebar' ) || ( $sidebar_layout == 'left-sidebar' ) ){ $return = $class ? 'leftsidebar' : 'sidebar'; } }else{ $return = $class ? 'full-width' : false; } }elseif( is_single() ){ if( is_active_sidebar( 'sidebar' ) ){ if( $sidebar_layout == 'no-sidebar' || ( $sidebar_layout == 'default-sidebar' && $post_layout == 'no-sidebar' ) ){ $return = $class ? 'full-width' : false; }elseif( $sidebar_layout == 'centered' || ( $sidebar_layout == 'default-sidebar' && $post_layout == 'centered' ) ){ $return = $class ? 'full-width centered' : false; }elseif( ( $sidebar_layout == 'default-sidebar' && $post_layout == 'right-sidebar' ) || ( $sidebar_layout == 'right-sidebar' ) ){ $return = $class ? 'rightsidebar' : 'sidebar'; }elseif( ( $sidebar_layout == 'default-sidebar' && $post_layout == 'left-sidebar' ) || ( $sidebar_layout == 'left-sidebar' ) ){ $return = $class ? 'leftsidebar' : 'sidebar'; } }else{ $return = $class ? 'full-width' : false; } } }elseif( blossom_recipe_is_woocommerce_activated() && ( is_shop() || is_product_category() || is_product_tag() || get_post_type() == 'product' ) ){ if( $layout == 'no-sidebar' ){ $return = $class ? 'full-width' : false; }elseif( is_active_sidebar( 'shop-sidebar' ) ){ if( $class ){ if( $layout == 'right-sidebar' ) $return = 'rightsidebar'; //With Sidebar if( $layout == 'left-sidebar' ) $return = 'leftsidebar'; } }else{ $return = $class ? 'full-width' : false; } }elseif( blossom_recipe_is_delicious_recipe_activated() && ( is_post_type_archive( 'recipe' ) || is_tax( 'recipe-course' ) || is_tax( 'recipe-cuisine' ) || is_tax( 'recipe-cooking-method' ) || is_tax( 'recipe-key' ) || is_tax( 'recipe-tag' ) ) ){ if( $layout == 'no-sidebar' ){ $return = $class ? 'full-width' : false; //Fullwidth }elseif( is_active_sidebar( 'delicious-recipe-sidebar' ) ){ if( $class ){ if( $layout == 'right-sidebar' ) $return = 'rightsidebar'; //With Sidebar if( $layout == 'left-sidebar' ) $return = 'leftsidebar'; }else{ $return = 'delicious-recipe-sidebar'; } }else{ $return = $class ? 'full-width' : false; //Fullwidth } }elseif( blossom_recipe_is_delicious_recipe_activated() && is_singular( DELICIOUS_RECIPE_POST_TYPE ) ){ if( $post_layout == 'no-sidebar' ){ $return = $class ? 'full-width' : false; //Fullwidth }elseif( $post_layout == 'centered' ){ $return = $class ? 'full-width centered' : false; //Fullwidth }elseif( is_active_sidebar( 'delicious-recipe-sidebar' ) ){ if( $class ){ if( $post_layout == 'right-sidebar' ) $return = 'rightsidebar'; //With Sidebar if( $post_layout == 'left-sidebar' ) $return = 'leftsidebar'; }else{ $return = 'delicious-recipe-sidebar'; } }else{ $return = $class ? 'full-width' : false; //Fullwidth } }elseif( is_404() ) { $return = $class ? 'full-width' : false; }else{ if( $layout == 'no-sidebar' ){ $return = $class ? 'full-width' : false; }elseif( is_active_sidebar( 'sidebar' ) ){ if( $class ){ if( $layout == 'right-sidebar' ) $return = 'rightsidebar'; //With Sidebar if( $layout == 'left-sidebar' ) $return = 'leftsidebar'; }else{ $return = 'sidebar'; } }else{ $return = $class ? 'full-width' : false; } } return $return; } endif; if( ! function_exists( 'blossom_recipe_get_categories' ) ) : /** * Function to list post categories in customizer options */ function blossom_recipe_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-recipe' ); 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_recipe_escape_text_tags' ) ) : /** * Remove new line tags from string * * @param $text * @return string */ function blossom_recipe_escape_text_tags( $text ) { return (string) str_replace( array( "\r", "\n" ), '', strip_tags( $text ) ); } endif; if( ! function_exists( 'blossom_recipe_get_image_sizes' ) ) : /** * Get information about available image sizes */ function blossom_recipe_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_recipe_get_fallback_svg' ) ) : /** * Get Fallback SVG */ function blossom_recipe_get_fallback_svg( $post_thumbnail ) { if( ! $post_thumbnail ){ return; } $image_size = blossom_recipe_get_image_sizes( $post_thumbnail ); if( $image_size ){ ?>
    urlencode( implode( '|', $fonts ) ), 'subset' => urlencode( $subsets ), ); if ( $fonts ) { $fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ); } if( get_theme_mod( 'ed_localgoogle_fonts', false ) ) { $fonts_url = blossom_recipe_get_webfont_url( add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ) ); } return esc_url_raw( $fonts_url ); } endif; if ( ! function_exists( 'wp_body_open' ) ) : /** * Fire the wp_body_open action. * * Added for backwards compatibility to support pre 5.2.0 WordPress versions. * */ function wp_body_open() { /** * Triggered after the opening tag. * */ do_action( 'wp_body_open' ); } endif; if( ! function_exists( 'blossom_recipe_breadcrumb' ) ) : /** * Breadcrumbs */ function blossom_recipe_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-recipe' ) ); // 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_recipe_get_page_template_url' ) ) : /** * Returns page template url if not found returns home page url */ function blossom_recipe_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;