Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS WP & CSS Tricks-like navigation help Re: WP & CSS Tricks-like navigation help

#92457
isamj
Member

Ok.. you can ignore that. I guess i was going in the wrong direction.
I used titles to access navigation elements in combination with the following code to add category name to body class:

function category_id_class($classes) {
if(is_single() || is_category()){
global $post;
foreach((get_the_category($post->ID)) as $category)
$classes[] = $category->category_nicename;
}
return $classes;
}
add_filter('post_class', 'category_id_class');
add_filter('body_class', 'category_id_class');

Accodringly, CSS was like:

.catName [title=cat title]{
}

IE8 will need DOCTYPE declared.