The body_class should return classes that belong to specific page/post regardless if you have latest posts or static page selected.
Something is not working or you have configured settings/templates incorrectly.
I’ve tested with clean install of WordPress along with blank themes from [HTML5 Reset](https://github.com/murtaugh/HTML5-Reset-Wordpress-Theme) and [Bones](https://github.com/eddiemachado/bones).
You can try using [conditional statement](http://codex.wordpress.org/Function_Reference/is_front_page) `is_front_page()` to check if user is on Front Page then just output corresponding classed to the body. But this should not be necessary, `body_class()` should take care of this…
I just installed a fresh version of Starkers, only copying over the
header.php. In Starkers, they differentiate between
html-header.php. So, the only things I copied over were styles and the menu basically. And it is still not giving me a body class for Blog. You can see here for yourself. So, I do not know what is causing it.
Edit #1: I just removed
style.css and it is still not giving me a body class. So it has to be something in the
header.php. Hrm. Let me remove that and see if it does anything.
Edit #2: Nope. It still does not have a body class even if I replace
header.php. Suggestions? Do I need to reinstall WordPress in its entirety?
Wait, wait… the `body_class()` is a WordPress function. It has nothing to do with CSS file. It simply outputs page, post, environment details to `body` html element so that you can target them in your style sheet. These “classes” are predefined by WordPress.
You could add custom classes, like so:>
Okay, I replaced the
wp-includes, no luck thus far. I will read the article now.
Edit: I read the article. In order for me to use that article’s method, I would first need a body class, which I do not have. I find it very strange that every page is producing an unique body class except for
/blog/, simply because I am using a static page for
home. This is very frustrating.
You must be logged in to reply to this topic.
*May or may not contain any actual "CSS" or "Tricks".