class="">
> home_url(), 'label' => __( 'Home', 'layerswp') ); if( is_search() ) { $breadcrumbs[ 'search' ] = array( 'link' => FALSE, 'label' => __( 'Search', 'layerswp' ), ); } elseif( function_exists('is_shop') && ( is_post_type_archive( 'product' ) || ( get_post_type() == "product") ) ) { if( function_exists( 'woocommerce_get_page_id' ) && '-1' != woocommerce_get_page_id('shop') ) { $shop_page_id = woocommerce_get_page_id('shop'); $shop_page = get_post( $shop_page_id ); if( is_object ( $shop_page ) ) { $breadcrumbs[ 'shop_page' ] = array( 'link' => get_permalink( $shop_page->ID ), 'label' => $shop_page->post_title, ); } } else { $breadcrumbs[ 'shop_page' ] = array( 'link' => FALSE, 'label' => __( 'Shop' , 'layerswp' ), ); } } elseif( is_post_type_archive() || is_singular() || is_tax() ) { // Get the post type object $post_type = get_post_type_object( get_post_type() ); // Check if we have the relevant information we need to query the page if( !empty( $post_type ) ) { // Query template if( isset( $post_type->has_archive) ) { $pt_slug = $post_type->has_archive; } elseif( isset( $post_type->labels->slug ) ) { $pt_slug = $post_type->labels->slug; } $parentpage = layers_get_template_link( 'template-' . $pt_slug . '.php' ); // Display page if it has been found if( !empty( $parentpage ) ) { $breadcrumbs[ $pt_slug. '_archive_page' ] = array( 'link' => get_permalink( $parentpage->ID ), 'label' => $parentpage->post_title, ); } }; } elseif( is_category() ){ $parentpage = layers_get_template_link( 'template-blog.php' ); if( empty( $parentpage ) ) { $parentpage = get_page( get_option( 'page_for_posts' ) ); } // Display page if it has been found if( !empty( $parentpage ) && 'post' !== $parentpage->post_type ) { $breadcrumbs[ 'post_archive_page' ] = array( 'link' => get_permalink( $parentpage->ID ), 'label' => $parentpage->post_title, ); } } /* Categories, Taxonomies & Parent Pages - Page parents - Category & Taxonomy parents - Category for current post - Taxonomy for current post */ if( is_page() ) { // Start with this page's parent ID $parent_id = $post->post_parent; // Loop through parent pages and grab their IDs while( $parent_id ) { $page = get_post($parent_id); $parent_pages[] = $page->ID; $parent_id = $page->post_parent; } // If there are parent pages, output them if( isset( $parent_pages ) && is_array($parent_pages) ) { $parent_pages = array_reverse($parent_pages); foreach ( $parent_pages as $page_id ) { $c_page = get_page( $page_id ); $breadcrumbs[ $c_page->post_name . '_page' ] = array( 'link' => get_permalink( $page_id ), 'label' => $c_page->post_title, ); } } } elseif( is_category() || is_tax() ) { // Get the taxonomy object if( is_category() ) { $category_title = single_cat_title( "", false ); $category_id = get_cat_ID( $category_title ); $category_object = get_category( $category_id ); if( is_object( $category_object ) ) { $term = $category_object->slug; } else { $term = ''; } $taxonomy = 'category'; $term_object = get_term_by( 'slug', $term , $taxonomy ); } else { $term = get_query_var('term' ); $taxonomy = get_query_var( 'taxonomy' ); $term_object = get_term_by( 'slug', $term , $taxonomy ); } if( is_object( $term_object ) ) $parent_id = $term_object->parent; else $parent_id = FALSE; // Start with this terms's parent ID // Loop through parent terms and grab their IDs while( $parent_id ) { $cat = get_term_by( 'id' , $parent_id , $taxonomy ); $parent_terms[] = $cat->term_id; $parent_id = $cat->parent; } // If there are parent terms, output them if( isset( $parent_terms ) && is_array($parent_terms) ) { $parent_terms = array_reverse($parent_terms); foreach ( $parent_terms as $term_id ) { $term = get_term_by( 'id' , $term_id , $taxonomy ); $breadcrumbs[ $term->slug ] = array( 'link' => get_term_link( $term_id , $taxonomy ), 'label' => $term->name, ); } } } elseif ( is_single() && get_post_type() == 'post' ) { // Get all post categories but use the first one in the array $category_array = get_the_category(); foreach ( $category_array as $category ) { $breadcrumbs[ $category->slug ] = array( 'link' => get_category_link( $category->term_id ), 'label' => get_cat_name( $category->term_id ), ); } } elseif( is_singular() ) { // Get the post type object $post_type = get_post_type_object( get_post_type() ); // If this is a product, make sure we're using the right term slug if( is_post_type_archive( 'product' ) || ( get_post_type() == "product" ) ) { $taxonomy = 'product_cat'; } elseif( !empty( $post_type ) && isset( $post_type->taxonomies[0] ) ) { $taxonomy = $post_type->taxonomies[0]; }; if( isset( $taxonomy ) && !is_wp_error( $taxonomy ) ) { // Get the terms $terms = get_the_terms( get_the_ID(), $taxonomy ); // If this term is legal, proceed if( is_array( $terms ) ) { // Loop over the terms for this post foreach ( $terms as $term ) { $breadcrumbs[ $term->slug ] = array( 'link' => get_term_link( $term->slug, $taxonomy ), 'label' => $term->name, ); } } } } /* Current Page / Post / Post Type - Page / Page / Post type title - Search term - Curreny Taxonomy - Current Tag - Current Category */ if( is_singular() ) { $breadcrumbs[ $post->post_name ] = array( 'link' => get_the_permalink(), 'label' => get_the_title(), ); } elseif ( is_search() ) { $breadcrumbs[ 'search_term' ] = array( 'link' => FALSE, 'label' => get_search_query(), ); } elseif( is_tax() ) { // Get this term's details $term = get_term_by( 'slug', get_query_var('term' ), get_query_var( 'taxonomy' ) ); $breadcrumbs[ 'taxonomy' ] = array( 'link' => FALSE, 'label' => $term->name, ); } elseif( is_tag() ) { // Get this term's details $term = get_term_by( 'slug', get_query_var('term' ), get_query_var( 'taxonomy' ) ); $breadcrumbs[ 'tag' ] = array( 'link' => FALSE, 'label' => single_tag_title( '', FALSE ), ); } elseif( is_category() ) { // Get this term's details $term = get_term_by( 'slug', get_query_var('term' ), get_query_var( 'taxonomy' ) ); $breadcrumbs[ 'category' ] = array( 'link' => FALSE, 'label' => single_cat_title( '', FALSE ), ); } elseif ( is_archive() && is_month() ) { $breadcrumbs[ 'month' ] = array( 'link' => FALSE, 'label' => get_the_date( 'F Y' ), ); } elseif ( is_archive() && is_year() ) { $breadcrumbs[ 'year' ] = array( 'link' => FALSE, 'label' => get_the_date( 'F Y' ), ); } elseif ( is_archive() && is_author() ) { $breadcrumbs[ 'author' ] = array( 'link' => FALSE, 'label' => get_the_author(), ); } return apply_filters( 'layers_breadcrumbs' , $breadcrumbs ); } } /** * Print pagination * * @param array $args Arguments for this function, including 'query', 'range' * @param string $wrapper Type of html wrapper * @param string $wrapper_class Class of HTML wrapper * @echo string Post Meta HTML */ if( !function_exists( 'layers_pagination' ) ) { function layers_pagination( $args = NULL , $wrapper = 'div', $wrapper_class = 'pagination' ) { // Set up some globals global $wp_query, $paged; // Get the current page if( empty($paged ) ) $paged = ( get_query_var('page') ? get_query_var('page') : 1 ); // Set a large number for the 'base' argument $big = 99999; // Get the correct post query if( !isset( $args[ 'query' ] ) ){ $use_query = $wp_query; } else { $use_query = $args[ 'query' ]; } ?> < class=""> str_replace( $big, '%#%', get_pagenum_link($big) ), 'prev_next' => true, 'mid_size' => ( isset( $args[ 'range' ] ) ? $args[ 'range' ] : 3 ) , 'prev_text' => '←', 'next_text' => '→', 'type' => 'list', 'current' => $paged, 'total' => $use_query->max_num_pages ) ); ?> > post_title; if($parentpage->post_excerpt != ''){ $title_array['excerpt'] = $parentpage->post_excerpt; } } elseif( function_exists('is_shop') && ( is_post_type_archive( 'product' ) || ( get_post_type() == "product") ) ) { if( function_exists( 'woocommerce_get_page_id' ) && -1 != woocommerce_get_page_id('shop') ) { $shop_page = get_post( woocommerce_get_page_id('shop') ); if( is_object( $shop_page ) ) { $title_array['title' ] = $shop_page->post_title; } } else { $title_array['title' ] = __( 'Shop' , 'layerswp' ); } } elseif( is_page() ) { while ( have_posts() ) { the_post(); $title_array['title'] = get_the_title(); if( $post->post_excerpt != "") $title_array['excerpt'] = strip_tags( get_the_excerpt() ); }; } elseif( is_search() ) { $title_array['title'] = __( 'Search' , 'layerswp' ); $title_array['excerpt'] = get_search_query(); } elseif( is_tag() ) { $title_array['title'] = single_tag_title( '' , false ); $title_array['excerpt'] = get_the_archive_description(); } elseif( !is_page() && is_category() ) { $title_array['title'] = single_cat_title( '', false ); $title_array['excerpt'] = get_the_archive_description(); } elseif (!is_page() && get_query_var('term' ) != '' ) { $term = get_term_by( 'slug', get_query_var('term' ), get_query_var( 'taxonomy' ) ); $title_array['title'] = $term->name; $title_array['excerpt'] = $term->description; } elseif( is_author() ) { $title_array['title'] = get_the_author(); $title_array['excerpt'] = get_the_author_meta('user_description'); } elseif ( is_day() ) { $title_array['title' ] = sprintf( __( 'Daily Archives: %s' , 'layerswp' ), get_the_date() ); } elseif ( is_month() ) { $title_array['title' ] = sprintf( __( 'Monthly Archives: %s' , 'layerswp' ), get_the_date( _x( 'F Y', 'monthly archives date format' , 'layerswp' ) ) ); } elseif ( is_year() ) { $title_array['title' ] = sprintf( __( 'Yearly Archives: %s' , 'layerswp' ), get_the_date( _x( 'Y', 'yearly archives date format' , 'layerswp' ) ) ); } elseif( is_single() ) { $title_array['title' ] = get_the_title(); } else { $title_array['title' ] = __( 'Archives' , 'layerswp' ); } return apply_filters( 'layers_get_page_title' , $title_array ); } } // layers_get_page_title /** * Set body classes. */ if( !function_exists( 'layers_body_class' ) ) { function layers_body_class( $classes ){ $header_menu_layout = layers_get_theme_mod( 'header-menu-layout'); $header_sticky_option = layers_get_theme_mod( 'header-sticky' ); $header_overlay_option = layers_get_theme_mod( 'header-overlay'); $left_sidebar_active = layers_can_show_sidebar( 'left-sidebar' ); $right_sidebar_active = layers_can_show_sidebar( 'right-sidebar' ); // Handle menu layout $classes[] = 'body-' . $header_menu_layout; // Handle sticky / not sticky if( TRUE == $header_sticky_option && 'header-sidebar' != $header_menu_layout ){ $classes[] = 'layers-header-sticky'; } // Handle overlay / not overlay if( TRUE == $header_overlay_option && 'header-sidebar' != $header_menu_layout ){ $classes[] = 'layers-header-overlay'; } // Add class that spans across all post archives and single pages if( layers_is_post_list_template() || is_archive() || is_singular( 'post' ) ) { $classes[] = 'layers-post-page'; } if( ( is_single() || is_archive() ) && !$left_sidebar_active && !$right_sidebar_active ){ $classes[] = 'no-sidebar'; } if( ( is_single() || is_archive() ) && $left_sidebar_active ) { $classes[] = 'left-sidebar'; } if( ( is_single() || is_archive() ) && $right_sidebar_active ) { $classes[] = 'right-sidebar'; } return apply_filters( 'layers_body_class', $classes ); } } // layers_body_class add_action( 'body_class', 'layers_body_class' ); /** * Check for a Layers Blog List Page */ if( !function_exists( 'layers_is_post_list_template' ) ) { function layers_is_post_list_template() { if( is_page_template( 'template-blog.php' ) || is_page_template( 'template-both-sidebar.php' ) || is_page_template( 'template-left-sidebar.php' ) || is_page_template( 'template-right-sidebar.php' ) ){ return TRUE; } else { return FALSE; } } } /** * Apply Customizer settings to site housing */ if( !function_exists( 'layers_apply_customizer_styles' ) ) { function layers_apply_customizer_styles() { /** * Setup the colors to use below */ $main_color = layers_get_theme_mod( 'site-accent-color' , TRUE ); $header_color = layers_get_theme_mod( 'header-background-color', FALSE ); $header_color_no_default = layers_get_theme_mod( 'header-background-color', TRUE ); $footer_color = layers_get_theme_mod( 'footer-background-color', FALSE ); /** * Header Colors */ $bg_opacity = 1; // Apply the BG Color if( '' != $header_color ) { layers_inline_styles( '.header-site, .header-site.header-sticky', 'css', array( 'css' => 'background-color: rgba(' . implode( ', ' , layers_hex2rgb( $header_color ) ) . ', ' . $bg_opacity . '); ' )); // Add Invert if the color is not light if ( 'dark' == layers_is_light_or_dark( $header_color ) ){ add_filter( 'layers_header_class', 'layers_add_invert_class' ); } } /** * General Colors */ if( '' != $header_color ) { // Title Container layers_inline_styles( '.title-container', 'background', array( 'background' => array( 'color' => $header_color ) ) ); if ( 'dark' == layers_is_light_or_dark( $header_color ) ){ add_filter( 'layers_title_container_class', 'layers_add_invert_class' ); } } if( '' != $main_color ) { // Buttons // layers_inline_button_styles( '', 'button', array( // 'selectors' => array( // 'input[type="button"]', 'input[type="submit"]', 'button', '.button', '.form-submit input[type="submit"]', // // Inverts // '.invert input[type="button"]', '.invert input[type="submit"]', '.invert button', '.invert .button', '.invert .form-submit input[type="submit"]', // ), // 'button' => array( // 'background-color' => $main_color, // ) // )); // // // Content - Links // layers_inline_styles( array( // 'selectors' => array( '.copy a:not(.button)', '.story a:not(.button)' ), // 'css' => array( // 'color' => $main_color, // 'border-bottom-color' => $main_color, // ), // )); // layers_inline_styles( array( // 'selectors' => array( '.copy a:not(.button):hover', '.story a:not(.button):hover' ), // 'css' => array( // 'color' => layers_too_light_then_dark( $main_color ), // 'border-bottom-color' => layers_too_light_then_dark( $main_color ), // ), // )); // Debugging: global $wp_customize; if ( $wp_customize && ( ( bool ) layers_get_theme_mod( 'dev-switch-button-css-testing' ) ) ) { echo ''; echo 'RE: Buttons - This should not happen if Layers Pro is active!'; echo ''; } } /** * Footer Colors. */ if( '' != $footer_color ) { // Apply the BG Color layers_inline_styles( '.footer-site', 'background', array( 'background' => array( 'color' => $footer_color, ), )); // Add Invert if the color is dark if ( 'dark' == layers_is_light_or_dark( $footer_color ) ){ add_filter( 'layers_footer_site_class', 'layers_add_invert_class' ); } } } } add_action( 'wp_enqueue_scripts', 'layers_apply_customizer_styles', 50 ); /** * Helpers that simply add/remove the invert class to an array of classes. * For use in conjunction with Filters. * * @param array $class Existing array of classes passed by the filter. */ if( !function_exists( 'layers_add_invert_class' ) ) { function layers_add_invert_class( $classes ) { $classes[] = 'invert'; return $classes; } } if( !function_exists( 'layers_remove_invert_class' ) ) { function layers_remove_invert_class( $classes ) { $classes = array_diff( $classes, array( 'invert' ) ); return $classes; } } /** * Helper that checks if a color is light or dark then hooks an invert filter to a get_class. * * @param string $color Hex color to check aginst. * @param string $hook Name of the to add the 'invert' to if the color is dark. * * @return bool Whether the color was dark, hook exists, invert was hooked successfuly */ if( !function_exists( 'layers_maybe_set_invert' ) ) { function layers_maybe_set_invert( $color, $hook ) { if ( 'dark' == layers_is_light_or_dark( $color ) ) { return add_filter( $hook, 'layers_add_invert_class' ); } else { return add_filter( $hook, 'layers_remove_invert_class' ); } } } /** * Retrieve the classes for the header element as an array. * * @param string|array $class One or more classes to add to the class list. * @return array Array of classes. */ if( !function_exists( 'layers_get_header_class' ) ) { function layers_get_header_class( $class = '' ){ $header_menu_layout = layers_get_theme_mod( 'header-menu-layout'); $header_align_option = layers_get_theme_mod( 'header-menu-layout' ); $header_sticky_option = layers_get_theme_mod( 'header-sticky' ); $header_overlay_option = layers_get_theme_mod( 'header-overlay'); $header_full_width_option = layers_get_theme_mod( 'header-width' ); $header_background_color_option = layers_get_theme_mod( 'header-background-color' ); $classes = array(); // Add the general site header class $classes[] = 'header-site'; // Handle sticky / not sticky if( TRUE == $header_sticky_option && 'header-sidebar' != $header_menu_layout ){ $classes[] = 'header-sticky'; } // Handle overlay / not overlay if( TRUE == $header_overlay_option && 'header-sidebar' != $header_menu_layout ){ $classes[] = 'header-overlay'; } // Add full-width class if( 'layout-fullwidth' == $header_full_width_option ) { $classes[] = 'content'; } // Add alignment classes if( 'header-logo-left' == $header_align_option ){ $classes[] = 'header-left'; } else if( 'header-logo-right' == $header_align_option ){ $classes[] = 'header-right'; } else if( 'header-logo-top' == $header_align_option ){ $classes[] = 'nav-clear'; } else if( 'header-logo-center-top' == $header_align_option ){ $classes[] = 'header-center'; } else if( 'header-logo-center' == $header_align_option ){ $classes[] = 'header-inline'; } if ( ! empty( $class ) ) { if ( !is_array( $class ) ) $class = preg_split( '#\s+#', $class ); $classes[] = array_merge( $classes, $class ); } else { // Ensure that we always coerce class to being an array. $class = array(); } // Default to Header Left if there are no matches above if( empty( $classes ) ) $classes[] = 'header-left'; $classes = apply_filters( 'layers_header_class', $classes, $class ); return $classes; } } // layers_get_header_class /** * Display the classes for the header element. * * @param string|array $class One or more classes to add to the class list. */ if( !function_exists( 'layers_header_class' ) ) { function layers_header_class( $class = '' ) { // Separates classes with a single space, collates classes for body element echo 'class="' , join( ' ', layers_get_header_class( $class ) ) , '"'; } } // layers_header_class /** * Retrieve the classes for the wrapper element as an array. * * @param string|array $class One or more classes to add to the class list. * @return array Array of classes. */ if( !function_exists( 'layers_get_site_wrapper_class' ) ) { function layers_get_site_wrapper_class( $class = '' ){ $classes = array(); $classes[] = 'wrapper-site'; $classes = apply_filters( 'layer_site_wrapper_class', $classes, $class ); return $classes; } } // layers_get_site_wrapper_class /** * Display the classes for the wrapper element. * * @param string|array $class One or more classes to add to the class list. */ if( !function_exists( 'layer_site_wrapper_class' ) ) { function layer_site_wrapper_class( $class = '' ) { // Separates classes with a single space, collates classes for body element echo 'class="' , join( ' ', layers_get_site_wrapper_class( $class ) ) , '"'; } } // layer_site_wrapper_class /** * Retrieve the classes for the wrapper content element as an array. * * @param string|array $class One or more classes to add to the class list. * @return array Array of classes. */ if( !function_exists( 'layers_get_wrapper_content_class' ) ) { function layers_get_wrapper_content_class( $class = '' ){ $classes = array(); $classes[] = 'wrapper-content'; $classes = apply_filters( 'layers_wrapper_content_class', $classes, $class ); return $classes; } } /** * Display the classes for the wrapper content element. * * @param string|array $class One or more classes to add to the class list. */ if( !function_exists( 'layers_wrapper_content_class' ) ) { function layers_wrapper_content_class( $class = '' ) { // Separates classes with a single space, collates classes for body element echo 'class="' , join( ' ', layers_get_wrapper_content_class( $class ) ) , '"'; } } /** * Retrieve the classes for the center column on archive and single pages * * @param string $postid Post ID to check the page template on * @return array Array of classes. */ if( !function_exists( 'layers_get_center_column_class' ) ) { function layers_get_center_column_class( $class = '' ){ $classes = array(); // This div will always have the .column class $classes[] = 'column'; $left_sidebar_active = layers_can_show_sidebar( 'left-sidebar' ); $right_sidebar_active = layers_can_show_sidebar( 'right-sidebar' ); // Set classes according to the sidebars if( $left_sidebar_active && $right_sidebar_active ){ $classes[] = 'span-6'; } else if( $left_sidebar_active ){ $classes[] = 'span-8'; } else if( $right_sidebar_active ){ $classes[] = 'span-8'; } else { $classes[] = 'span-12'; } // If there is a left sidebar and no right sidebar, add the no-gutter class if( $left_sidebar_active && !$right_sidebar_active ){ $classes[] = 'no-gutter'; } // Default to Header Left if there are no matches above if( empty( $classes ) ) { $classes[] = 'span-8'; } // Apply any classes passed as parameter if( '' != $class ) $classes[] = $class; $classes = array_map( 'esc_attr', $classes ); $classes = apply_filters( 'layers_center_column_class', $classes, $class ); return array_unique( $classes ); } } // layers_get_center_column_class /** * Display the classes for the header element. * * @param string|array $class One or more classes to add to the class list. */ if( !function_exists( 'layers_center_column_class' ) ) { function layers_center_column_class( $class = '' ) { // Separates classes with a single space, collates classes for body element echo 'class="' , join( ' ', layers_get_center_column_class( $class ) ) , '"'; } } // layers_center_column_class /** * Display the classes for the wrapper content element. * * @param string $key Key to be used to populate the filter. * @param string $class One or more classes to add to the class list. */ if( !function_exists( 'layers_wrapper_class' ) ) { function layers_wrapper_class( $key = '', $class = '' ) { echo 'class="' , join( ' ', layers_get_wrapper_class( $key, $class ) ) , '"'; } } /** * Get the classes for the wrapper content element. * * @param string $key Key to be used to populate the filter. * @param string $class One or more classes to add to the class list. * * @return string html style list of classes */ if( !function_exists( 'layers_get_wrapper_class' ) ) { function layers_get_wrapper_class( $key = '', $class = '' ) { $classes = explode( ' ', $class ); // Convert string of classes to an array return apply_filters( 'layers_' . $key . '_class', $classes ); } } /** * Retrieve theme modification value for the current theme. * * @param string $name Theme modification name. * @param string $allow_empty Whether the Theme modification should return empty, or the default, if no value is set. * @return string */ if( !function_exists( 'layers_get_theme_mod' ) ) { function layers_get_theme_mod( $name = '', $allow_empty = TRUE ) { global $layers_customizer_defaults; // Add the theme prefix to our layers option $name = LAYERS_THEME_SLUG . '-' . $name; // Set theme option default $default = ( isset( $layers_customizer_defaults[ $name ][ 'value' ] ) ? $layers_customizer_defaults[ $name ][ 'value' ] : FALSE ); // Get theme option $theme_mod = get_theme_mod( $name, $default ); // Template can choose whether to allow empty if ( '' == $theme_mod && FALSE == $allow_empty && FALSE != $default ) { $theme_mod = $default; } // Return theme option return $theme_mod; } } // layers_get_header_class /** * Check customizer and page template settings before allowing a sidebar to display * * @param int $sidebar Sidebar slug to check */ if( !function_exists( 'layers_can_show_sidebar' ) ) { function layers_can_show_sidebar( $sidebar = 'left-sidebar' ){ if ( is_page_template( 'template-blog.php' ) ) { // Check the arhive page option $can_show_sidebar = layers_get_theme_mod( 'archive-' . $sidebar ); } else if( is_page() ) { // Check the pages use page templates to decide which sidebars are allowed $can_show_sidebar = ( is_page_template( 'template-' . $sidebar . '.php' ) || is_page_template( 'template-both-sidebar.php' ) ); } elseif ( is_single() ) { // Check the single page option $can_show_sidebar = layers_get_theme_mod( 'single-' . $sidebar ); } else { // Check the arhive page option $can_show_sidebar = layers_get_theme_mod( 'archive-' . $sidebar ); } return $classes = apply_filters( 'layers_can_show_sidebar', $can_show_sidebar, $sidebar ); } } /** * Check customizer and page template settings before displaying a sidebar * * @param int $sidebar Sidebar slug to check * @param string $container_class Sidebar container class * @return html $sidebar Sidebar template */ if( !function_exists( 'layers_maybe_get_sidebar' ) ) { function layers_maybe_get_sidebar( $sidebar = 'left', $container_class = 'column', $return = FALSE ) { global $post; $show_sidebar = layers_can_show_sidebar( $sidebar ); if( TRUE == $show_sidebar ) { ?>