%4$s'; $on = __( 'updated on ', 'blossom-travel' ); }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_travel_posted_by' ) ) : /** * Prints HTML with meta information for the current author. */ function blossom_travel_posted_by() { global $post; $ed_post_author = get_theme_mod( 'ed_post_author', false ); if( $ed_post_author ) return false; $byline = sprintf( /* translators: %s: post author. */ esc_html_x( 'by %s', 'post author', 'blossom-travel' ), '' ); echo ''; } endif; if( ! function_exists( 'blossom_travel_comment_count' ) ) : /** * Comment Count */ function blossom_travel_comment_count(){ $ed_comments = get_theme_mod( 'ed_comments', false ); if ( ! post_password_required() && ( comments_open() || get_comments_number() ) && !$ed_comments ) { echo ''; comments_popup_link( sprintf( wp_kses( /* translators: %s: post title */ __( '0 Comment on %s', 'blossom-travel' ), array( 'span' => array( 'class' => array(), ), ) ), get_the_title() ) ); echo ''; } } endif; if ( ! function_exists( 'blossom_travel_category' ) ) : /** * Prints categories */ function blossom_travel_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( ' ' ); if ( $categories_list ) { echo '' . $categories_list . ''; } } } endif; if ( ! function_exists( 'blossom_travel_tag' ) ) : /** * Prints tags */ function blossom_travel_tag(){ // Hide category and tag text for pages. if ( 'post' === get_post_type() ) { /* translators: used between list items, there is a space after the comma */ $tags_list = get_the_tag_list( ' ' ); if ( $tags_list ) { /* translators: 1: list of tags. */ printf( '' . esc_html__( '%1$sTags:%2$s %3$s', 'blossom-travel' ) . '', '', '', $tags_list ); } } } endif; if( ! function_exists( 'blossom_travel_get_posts_list' ) ) : /** * Returns Latest, Related & Popular Posts */ function blossom_travel_get_posts_list( $status ){ global $post; $args = array( 'post_type' => 'post', 'ignore_sticky_posts' => true ); switch( $status ){ case 'latest': $args['posts_per_page'] = 3; $title = __( 'You might also enjoy:', 'blossom-travel' ); $class = 'additional-post'; $image_size = 'blossom-travel-blog-two'; $readmore = get_theme_mod( 'read_more_text', __( 'Read', 'blossom-travel' ) ); 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 might also enjoy:', 'blossom-travel' ) ); $class = 'additional-post'; $image_size = 'blossom-travel-blog-two'; $readmore = get_theme_mod( 'read_more_text', __( 'Read', 'blossom-travel' ) ); $cats = get_the_category( $post->ID ); if( $cats ){ $c = array(); foreach( $cats as $cat ){ $c[] = $cat->term_id; } $args['category__in'] = $c; } } $qry = new WP_Query( $args ); if( $qry->have_posts() ){ ?>
' . esc_html( $title ) . ''; ?>
have_posts() ){ $qry->the_post(); ?>
'; if( is_front_page() ){ ?>

'; endif; ?>
'; ?> '; }elseif( $ed_social && $social_links ){ return true; }else{ return false; } ?>
'; echo '
  • ' . esc_html__( 'Click here to add a menu', 'blossom-travel' ) . '
  • '; echo ''; } } endif; if( ! function_exists( 'blossom_travel_header_search' ) ) : /** * Header Search */ function blossom_travel_header_search(){ ?>
    '; $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_travel_theme_comment' ) ) : /** * Callback function for Comment List * * * @link https://codex.wordpress.org/Function_Reference/wp_list_comments */ function blossom_travel_theme_comment( $comment, $args, $depth ){ if ( 'div' == $args['style'] ) { $tag = 'div'; $add_below = 'comment'; } else { $tag = 'li'; $add_below = 'div-comment'; } ?> < id="comment-">
    $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    ID, '_blossom_travel_sidebar_layout', true ) ){ $sidebar_layout = get_post_meta( $post->ID, '_blossom_travel_sidebar_layout', true ); }else{ $sidebar_layout = 'default-sidebar'; } if( is_page() ){ if( is_page_template( 'templates/blossom-portfolio.php' ) ) { $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_travel_is_woocommerce_activated() && ( is_shop() || is_product_category() || is_product_tag() || get_post_type() == 'product' ) ){ if( $layout == 'no-sidebar' ){ $return = $class ? 'full-width' : false; }elseif( is_active_sidebar( 'shop-sidebar' ) ){ if( $class ){ if( $layout == 'right-sidebar' ) $return = 'rightsidebar'; //With Sidebar if( $layout == 'left-sidebar' ) $return = 'leftsidebar'; } }else{ $return = $class ? 'full-width' : false; } }elseif( is_singular( 'blossom-portfolio' ) && 'blossom-portfolio' === get_post_type() ){ //For Portfolio Post Type $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_travel_get_posts' ) ) : /** * Fuction to list Custom Post Type */ function blossom_travel_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-travel' ); 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_travel_get_categories' ) ) : /** * Function to list post categories in customizer options */ function blossom_travel_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-travel' ); 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_travel_get_id_from_page' ) ) : /** * Get page ids from page name. */ function blossom_travel_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_travel_get_home_sections' ) ) : /** * Returns Home Sections */ function blossom_travel_get_home_sections(){ $sections = array( 'logo' => array( 'sidebar' => 'logo' ), 'about' => array( 'sidebar' => 'about' ), 'featured' => array( 'sidebar' => 'featured' ), 'blog' => array( 'section' => 'blog' ), 'map' => array( 'sidebar' => 'map' ), 'cta' => array( 'sidebar' => 'cta' ), 'newsletter' => array( 'sidebar' => 'newsletter' ), 'instagram' => array( 'section' => 'instagram' ), ); $enabled_section = array(); foreach( $sections as $k => $v ){ if( array_key_exists( 'sidebar', $v ) ){ if( is_active_sidebar( $v['sidebar'] ) ) array_push( $enabled_section, $v['sidebar'] ); }else{ if( get_theme_mod( 'ed_' . $v['section'] . '_section', true ) ) array_push( $enabled_section, $v['section'] ); } } return apply_filters( 'blossom_travel_home_sections', $enabled_section ); } endif; if( ! function_exists( 'blossom_travel_escape_text_tags' ) ) : /** * Remove new line tags from string * * @param $text * @return string */ function blossom_travel_escape_text_tags( $text ) { return (string) str_replace( array( "\r", "\n" ), '', strip_tags( $text ) ); } endif; if( ! function_exists( 'blossom_travel_get_image_sizes' ) ) : /** * Get information about available image sizes */ function blossom_travel_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_travel_get_fallback_svg' ) ) : /** * Get Fallback SVG */ function blossom_travel_get_fallback_svg( $post_thumbnail ) { if( ! $post_thumbnail ){ return; } $image_size = blossom_travel_get_image_sizes( $post_thumbnail ); if( $image_size ){ ?>
    tag. * */ do_action( 'wp_body_open' ); } endif; if( ! function_exists( 'blossom_travel_get_page_template_url' ) ) : /** * Returns page template url if not found returns home page url */ function blossom_travel_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;