%4$s'; }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 = '' . $time_string . ''; echo '' . $posted_on . ''; // WPCS: XSS OK. } endif; if ( ! function_exists( 'blossom_wedding_posted_by' ) ) : /** * Prints HTML with meta information for the current author. */ function blossom_wedding_posted_by() { $byline = sprintf( /* translators: %s: post author. */ esc_html_x( 'by %s', 'post author', 'blossom-wedding' ), '' ); echo ''; } endif; if( ! function_exists( 'blossom_wedding_comment_count' ) ) : /** * Comment Count */ function blossom_wedding_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-wedding' ), array( 'span' => array( 'class' => array(), ), ) ), get_the_title() ) ); echo ''; } } endif; if ( ! function_exists( 'blossom_wedding_category' ) ) : /** * Prints categories */ function blossom_wedding_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-wedding' ) ); if ( $categories_list ) { echo '' . $categories_list . ''; } } } endif; if ( ! function_exists( 'blossom_wedding_tag' ) ) : /** * Prints tags */ function blossom_wedding_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-wedding' ) . '
', '
', '
', $tags_list ); } } } endif; if( ! function_exists( 'blossom_wedding_get_posts_list' ) ) : /** * Returns Latest, Related & Popular Posts */ function blossom_wedding_get_posts_list( $status ){ global $post; $args = array( 'post_type' => 'post', 'ignore_sticky_posts' => true ); switch( $status ){ case 'latest': $args['posts_per_page'] = 4; $title = __( 'Recommended Articles', 'blossom-wedding' ); $class = 'additional-post'; $image_size = 'thumbnail'; break; case 'related': $args['posts_per_page'] = 3; $args['post__not_in'] = array( $post->ID ); $args['orderby'] = 'rand'; $title = get_theme_mod( 'related_post_title', __( 'Recommended Articles', 'blossom-wedding' ) ); $class = 'additional-post'; $image_size = 'thumbnail'; $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(); ?>
'; if( is_front_page() ){ ?>

'; endif; ?>
'; echo '
  • ' . esc_html__( 'Click here to add a menu', 'blossom-wedding' ) . '
  • '; echo ''; } } endif; if( ! function_exists( 'blossom_wedding_rsvp_flag' ) ) : /** * Reception Flag */ function blossom_wedding_rsvp_flag(){ $header_text = get_theme_mod( 'header_button_text', __( 'RSVP', 'blossom-wedding' ) ); $header_text_url = get_theme_mod( 'header_text_url' ); if( $header_text && $header_text_url ) : ?>
    < id="comment-">
    $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    ID, '_blossom_wedding_sidebar_layout', true ) ){ $sidebar_layout = get_post_meta( $post->ID, '_blossom_wedding_sidebar_layout', true ); }else{ $sidebar_layout = 'default-sidebar'; } if( is_page() ){ $template = array( 'templates/blossom-portfolio.php' ); if( is_page_template( $template ) ) { $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_wedding_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 = 'shop-sidebar'; } }else{ $return = $class ? 'full-width' : false; } }elseif( '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_wedding_get_posts' ) ) : /** * Fuction to list Custom Post Type */ function blossom_wedding_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-wedding' ); 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_wedding_get_categories' ) ) : /** * Function to list post categories in customizer options */ function blossom_wedding_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-wedding' ); 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_wedding_get_id_from_page' ) ) : /** * Get page ids from page name. */ function blossom_wedding_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_wedding_get_page_template_url' ) ) : /** * Returns page template url if not found returns home page url */ function blossom_wedding_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; if( ! function_exists( 'blossom_wedding_get_home_sections' ) ) : /** * Returns Home Sections */ function blossom_wedding_get_home_sections(){ $ed_banner = get_theme_mod( 'ed_banner_section', 'slider_banner' ); $sections = array( 'about' => array( 'sidebar' => 'about' ), 'story' => array( 'section' => 'story' ), 'quote' => array( 'sidebar' => 'quote' ), 'officiant' => array( 'section' => 'officiant' ), 'gallery' => array( 'sidebar' => 'gallery' ), 'invitation' => array( 'sidebar' => 'invitation' ), 'blog' => array( 'section' => 'blog' ) ); $enabled_section = array(); if( $ed_banner == 'static_banner' || $ed_banner == 'slider_banner' ) array_push( $enabled_section, 'banner' ); 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', false ) ) array_push( $enabled_section, $v['section'] ); } } return apply_filters( 'blossom_wedding_home_sections', $enabled_section ); } endif; if( ! function_exists( 'blossom_wedding_get_image_sizes' ) ) : /** * Get information about available image sizes */ function blossom_wedding_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_wedding_get_fallback_svg' ) ) : /** * Get Fallback SVG */ function blossom_wedding_get_fallback_svg( $post_thumbnail ) { if( ! $post_thumbnail ){ return; } $image_size = blossom_wedding_get_image_sizes( $post_thumbnail ); if( $image_size ){ ?>
    tag. * */ do_action( 'wp_body_open' ); } endif; if( ! function_exists( 'blossom_wedding_breadcrumb' ) ) : /** * Breadcrumbs */ function blossom_wedding_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-wedding' ) ); // 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;