Yes, it might be possible to extend the plugin to work with custom taxonomies. I am planning to update several of my plugins after WordPress 3.2 is released; I’ll look into making the requested change at that time.
OK, thanks ambrosite, i’ll try to be patient 🙂 for the record, yours is one of my favorite plugins – addresses a very specific need that i don’t see any other coming close to. thanks so much for your help!!
(think there’s anything I can hack together myself in the meantime as a bandaid fix? maybe something i’m overlooking?)
If I knew of an easy fix, I would have told you. 🙂 The fact is, I have not looked at this at all yet, and I won’t have a chance to do so for another week or two. As soon as I have a solution, I will share it here.
haha fair enough 🙂
(sorry, I just get anxious!)
I found a few bits of code that will place the taxonomy name in the body class of the main archive, but i’ve seen no way (thus far) if that can carry along to the posts within the taxonomy. Looking forward to putting it to good use!
Here is the beta version of Body Class Enhanced that has been extended to work with custom hierarchical taxonomies. I won’t be putting this in the plugin directory until after WordPress 3.2 is released, but in the meantime you can download it here:
http://www.ambrosite.com/download/ambrosite-body-class.1.3.zip
Let me know how it works for you.
like a charm!!
like a beautiful, CSS-styled charm 🙂
this is perfect 🙂 thank you SO much for your help (and for appeasing my ridiculous impatience!!)
I’m glad to hear it worked for you. I did make one change to the plugin after you downloaded it the first time — I decided to include the taxonomy name in the class name, on single posts only. In other words, they will take the form:
single-taxonomy–term
I felt it was important to be able to distinguish between taxonomies in cases where more than one custom hierarchical taxonomy is defined, and when the same term might appear in two or more taxonomies. For example, suppose you had a real estate site with property listings in New York City, and you had two custom taxonomies defined: City and State. Then the classes would look like this:
single-city-new-york single-state-new-york
The link I posted before has been updated.
I have added version 1.3 to the plugin directory. The above download link is dead; you can get the new version here:
http://wordpress.org/extend/plugins/ambrosite-body-class-enhanced/
I have made a few more fixes and tweaks, including the addition of multisite support, so anyone who downloaded the file before should be sure to get the latest version from the plugin directory.