????
Current Path : /home2/morganrand/backup.morganrand.com/wp-content/themes/wanderfuls/framework/ |
Current File : /home2/morganrand/backup.morganrand.com/wp-content/themes/wanderfuls/framework/body-classes.php |
<?php /** * Adds classes to the body tag * * @package Wanderfuls WordPress Theme * @subpackage Framework */ function tb_body_classes( $classes ) { // Save some vars $main_layout = tb_global_obj( 'main_layout' ); $header_style = tb_global_obj( 'header_style' ); $post_layout = tb_global_obj( 'post_layout' ); $post_id = tb_global_obj( 'post_id' ); // Customizer if ( is_customize_preview() ) { $classes[] = 'is_customize_preview'; } // Main class $classes[] = 'tb-theme'; // Responsive if ( tb_global_obj( 'responsive' ) ) { $classes[] = 'tb-responsive'; } // Layout Style $classes[] = $main_layout .'-main-layout'; // Add skin to body classes $classes[] = 'skin-'. tb_global_obj( 'skin' ); // Vertical header style if ( 'six' == $header_style) { $classes[] = 'tb-has-vertical-header'; if ( 'fixed' == tb_get_mod( 'vertical_header_style' ) ) { $classes[] = 'tb-fixed-vertical-header'; } } // Check if the Visual Composer is being used on this page if ( tb_global_obj( 'has_composer' ) ) { $classes[] = 'has-composer'; } else { $classes[] = 'no-composer'; } // Live site class if ( ! tb_global_obj( 'vc_is_inline' ) ) { $classes[] = 'tb-live-site'; } // Boxed Layout dropshadow if ( 'boxed' == $main_layout && tb_get_mod( 'boxed_dropdshadow' ) && 'gaps' != tb_global_obj( 'skin' ) ) { $classes[] = 'wrap-boxshadow'; } // Sidebar enabled if ( 'left-sidebar' == $post_layout || 'right-sidebar' == $post_layout ) { $classes[] = 'has-sidebar'; } // Content layout if ( $post_layout ) { $classes[] = 'content-'. $post_layout; } // Single Post cagegories if ( is_singular( 'post' ) ) { $cats = get_the_category( $post_id ); foreach ( $cats as $cat ) { $classes[] = 'post-in-category-'. $cat->category_nicename; } } // Breadcrumbs if ( 'default' == tb_get_mod( 'breadcrumbs_position', 'default' ) && ( tb_global_obj( 'has_breadcrumbs' ) || current_theme_supports( 'yoast-seo-breadcrumbs' ) ) ) { $classes[] = 'has-breadcrumbs'; } // Topbar if ( tb_global_obj( 'has_top_bar' ) ) { $classes[] = 'has-topbar'; } // Widget Icons if ( tb_get_mod( 'has_widget_icons', true ) ) { $classes[] = 'sidebar-widget-icons'; } // Overlay header style if ( tb_global_obj( 'has_overlay_header' ) ) { $classes[] = 'has-overlay-header'; } // Footer reveal if ( tb_global_obj( 'has_footer_reveal' ) ) { $classes[] = 'footer-has-reveal'; } // Slider if ( tb_global_obj( 'has_post_slider' ) ) { $classes[] = 'page-with-slider'; } // No header margin if ( 'on' == get_post_meta( $post_id, 'tb_disable_header_margin', true ) ) { $classes[] = 'no-header-margin'; } // Title with Background Image if ( 'background-image' == tb_global_obj( 'page_header_style' ) ) { $classes[] = 'page-with-background-title'; } // Disabled header if ( ! tb_global_obj( 'has_page_header' ) ) { $classes[] = 'page-header-disabled'; } // Disabled main header if ( ! tb_global_obj( 'has_header' ) ) { $classes[] = 'tb-site-header-disabled'; } // Page slider if ( tb_global_obj( 'has_post_slider' ) && $slider_position = tb_global_obj( 'post_slider_position' ) ) { $classes[] = 'has-post-slider'; $slider_position = str_replace( '_', '-', $slider_position ); $classes[] = 'post-slider-'. $slider_position; } // Font smoothing if ( tb_get_mod( 'enable_font_smoothing' ) ) { $classes[] = 'smooth-fonts'; } // Mobile menu toggle style $classes[] = 'tb-mobile-toggle-menu-'. tb_global_obj( 'mobile_menu_toggle_style' ); // Mobile menu style if ( 'disabled' == tb_global_obj( 'mobile_menu_style' ) ) { $classes[] = 'mobile-menu-disabled'; } else { $classes[] = 'has-mobile-menu'; } // Return classes return $classes; } add_filter( 'body_class', 'tb_body_classes' );