Quote:
Originally Posted by drongo
Didn't work for me. I had to write
<h1 class="blogtitle">...
instead of
<h1 id="blogtitle">...
Greetings, Drongo
|
I fixed the post above.
Quote:
Is is possible to ask for the category-attribute inside a post?
|
At the bottom of functions.php add:
PHP Code:
function add_cats_to_body_class($classes='') {
if (is_single()) {
global $post;
$categories = get_the_category($post->ID);
foreach ($categories as $category) {
$classes[] = 'in-cat-' . $category->category_nicename;
}
}
return $classes;
}
add_filter('body_class', 'add_cats_to_body_class');