function theme_body_class($classes) { global $theLayout, $theHeader, $theFooter, $bp; // add classes to body tag based on theme settings // fade in content (set's a special "invisible" class) switch (get_theme_var('options,fade_in_content')) { case 'all': $classes[] = 'invisibleAll'; break; case 'content': $classes[] = 'invisibleMiddle'; break; } // header content if (!$theHeader['content']) { $classes[] = 'noHeaderContent'; } // background slider $ss = get_ss($theHeader); if (isset($ss['ss-type']) && $ss['ss-type'] == 'ss-bgSlider') { $classes[] = 'hasBgSlider'; } // theme skin if (get_theme_skin()) { $classes[] = str_replace('.css', '', get_theme_skin()); } // BP Specific if (bp_plugin_is_active()) { // Groups if (bp_is_groups_component() && isset($bp->groups->current_group->id)) { $classes[] = 'bp-group-' . $bp->groups->current_group->id; } } // is responsive if (get_theme_var('options,responsive', 'active') !== 'inactive') { $classes[] = 'isResponsive'; } // return the $classes array return $classes; }
function add_theme_body_class($classes) { // Get layout data $layout = get_layout_options(); // Get layout data $layout_data = get_layout_options('other_options'); $layout_options = !empty($layout_data) ? $layout_data : false; // Get header and footer information $header_data = get_layout_options('header'); $header = isset($header_data) ? $header_data : false; // Layout Specific //............................................... if ($layout && isset($layout['title'])) { $classes[] = 'layout-' . sanitize_title($layout['title']); } else { // If not using Layout Manager (or if error, fallback is default WP functionality) $classes[] = 'no-layout'; // More cases specific no Layout Manager if (!is_active_sidebar('sidebar-default') || is_page_template('templates/full-width.php') || is_page_template('templates/grid-rows.php') || is_page_template('templates/grid-rows-filtered.php') || is_page_template('templates/grid-staggered.php') || is_page_template('templates/grid-staggered-filtered.php') || is_tax('portfolio-category') || is_singular('portfolio')) { $classes[] = 'full-width'; } } // Blank page if (is_page_template('templates/blank-page.php')) { $classes[] = 'blank-page'; } // Layout Style $layout_style = !empty($layout_options['layout-style']) ? $layout_options['layout-style'] : get_options_data('options-page', 'layout-style'); if (!empty($layout_style)) { $classes[] = $layout_style; } // Vertical Masthead (size) $masthead_size = !empty($header['masthead-size']) ? $header['masthead-size'] : get_options_data('options-page', 'masthead-size'); if (!empty($layout_style) && ($layout_style == 'boxed-left' || $layout_style == 'full-width-left' || $layout_style == 'boxed-right' || $layout_style == 'full-width-right')) { $classes[] = $masthead_size; } // Image overlay effect $overlay_effect = get_options_data('options-page', 'image-overlay-effect'); if (!empty($overlay_effect)) { $classes[] = 'overlay-effect-' . $overlay_effect; } // Skin $skin = get_theme_skin(); if (isset($skin) && !empty($skin)) { $skin_class = str_replace('.css', '', $skin); $classes[] = $skin_class; } // context if (isset($GLOBALS['context'])) { $classes[] = 'context-' . $GLOBALS['context']; } // Generic WP //............................................... // Post thumbnails if (!is_404() && has_post_thumbnail()) { $classes[] = 'has-post-thumbnail'; } // No author names on posts when site has only one author if (!is_multi_author()) { $classes[] = 'single-author'; } return $classes; }