From dedbc54e1a129848def5a677c8626932748e8073 Mon Sep 17 00:00:00 2001 From: Ben Word Date: Wed, 21 Sep 2011 18:53:28 -0600 Subject: [PATCH] pulling in #137 with slight modifications, thx @moimikey --- header.php | 2 +- inc/roots-cleanup.php | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/header.php b/header.php index a095ce5..c03f9d4 100644 --- a/header.php +++ b/header.php @@ -25,7 +25,7 @@ -post_name); } else { body_class(); }?>> +>
diff --git a/inc/roots-cleanup.php b/inc/roots-cleanup.php index c055b33..c8f461d 100644 --- a/inc/roots-cleanup.php +++ b/inc/roots-cleanup.php @@ -442,4 +442,21 @@ function roots_clean_style_tag($input) { return '' . "\n"; } +function roots_body_class() { + $term = get_queried_object(); + var_dump($term); + if (is_single()) + $cat = get_the_category(); + 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; +} + ?>