roots_body_class() is no longer necessary for body_class()
This commit is contained in:
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body <?php body_class(roots_body_class()); ?>>
|
<body <?php body_class(); ?>>
|
||||||
|
|
||||||
<!--[if lt IE 7]><p class="chromeframe">Your browser is <em>ancient!</em> <a href="http://browsehappy.com/">Upgrade to a different browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to experience this site.</p><![endif]-->
|
<!--[if lt IE 7]><p class="chromeframe">Your browser is <em>ancient!</em> <a href="http://browsehappy.com/">Upgrade to a different browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to experience this site.</p><![endif]-->
|
||||||
|
|
||||||
|
|||||||
@@ -621,30 +621,6 @@ function roots_body_class_filter($classes) {
|
|||||||
}
|
}
|
||||||
add_filter('body_class', 'roots_body_class_filter');
|
add_filter('body_class', 'roots_body_class_filter');
|
||||||
|
|
||||||
function roots_body_class() {
|
|
||||||
$term = get_queried_object();
|
|
||||||
|
|
||||||
if (is_single()) {
|
|
||||||
$cat = get_the_category();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_front_page()) {
|
|
||||||
return; // Avoid duplicate 'home' class when using static front page
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!empty($cat)) {
|
|
||||||
return $cat[0]->slug;
|
|
||||||
} elseif (isset($term->slug)) {
|
|
||||||
return $term->slug;
|
|
||||||
} elseif (isset($term->page_name)) {
|
|
||||||
return $term->page_name;
|
|
||||||
} elseif (isset($term->post_name)) {
|
|
||||||
return $term->post_name;
|
|
||||||
} else {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// first and last classes for widgets
|
// first and last classes for widgets
|
||||||
// http://wordpress.org/support/topic/how-to-first-and-last-css-classes-for-sidebar-widgets
|
// http://wordpress.org/support/topic/how-to-first-and-last-css-classes-for-sidebar-widgets
|
||||||
function roots_widget_first_last_classes($params) {
|
function roots_widget_first_last_classes($params) {
|
||||||
|
|||||||
Reference in New Issue
Block a user