
In 2.7 WordPress added threaded comments with a neat little function that would output the comment code complete with loads of standard CSS classes, we also have post_class which outputs standard classes for post. In 2.8 the class-fest goes further with a new function: body_class.
Body class goes in the body tag of each web page and outputs classes depending on the type of page that is being viewed. At the moment it outputs the following classes (it should be obvious what each is for)
I guess there is still some cleaning up to do on this as there are a few missing options, but it looks to be comprehensive and should help with further standardising themes.
Despite the obvious value of this though something just doesn’t sit right with me about creating core functions to output classes. I can’t put my finger on why I don’t like it at the moment, but as the concept is clearly here to stay I guess it doesn’t really matter. Enjoy the new classes.
(__)
`
been adding the fuction from sandbox 1.6 to some custom themes, this kind of classes help so much :) great it's getting in wp2.8
(__)
`
[...] What a body! [...]
(__)
`
[...] What a body! [...]
(__)
`
[...] otro tag para nuestros themes que especificar
(__)
`
[...] What a body! [...]
(__)
`
[...] What a body! [...]
(__)
`
[...] What a body! [...]
(__)
`
The idea was taken more or less directly from the Sandbox themes, which did this sort of thing as well. I think it's a good idea on the whole, because it standardizes several common theme tricks and removes a lot of the need for custom PHP code in themes to, for example, style posts by specific authors differently. End users have a hard time dealing with PHP, but can usually cope with simple CSS styling.
(__)
`
what about adding some of the features of this plugin: http://www.alistercameron.com/2007/01/04/wordpr... this plugin is brilliant in my opinion.
(__)
`
[...] What a body! [...]
(__)
`
I've been thinking about the class stuff as well.
My basic feeling is this: I can think of a few tangible benefits–ease of styling being by far the most prominent–but no meaningful deficit. Perhaps I'm missing something, but until it's pointed out it me I won't complain.