Last Updated on August 1, 2017
I needed to make CSS changes to a specific category on one of my WordPress sites, this plugin is the result. My WordPress side project started off as a simple review blog and then evolved into more than it was supposed to be. Because of this, I ended up with categories where I should have had custom post types. Rather than making the custom post types and converting the posts over I used this quick fix to make a certain category display much differently than the rest.
To be fair and give credit where credit is due – the code came directly from this blog post by Philip Newcomer and I put it into a plugin rather than adding it to my theme’s functions.php file.
Here is Philip’s description of the code:
Here’s a little function that will add each of a post’s categories to the body class of the single post page (assuming your theme uses the body_class template tag)..
To see how to make plugins instead of editing your theme’s functions.php file check out this blog post by Brian Hogg.
John started JSnowCreations as a place to post random tech guides and product reviews. However, while shopping for his daughter’s first “big girl” bed in 2019 he learned about the hidden dangers of fiberglass in mattresses. Since then, John has made it his mission to expose as much hidden fiberglass in mattresses as possible. His ultimate goal is federal regulations that ban fiberglass from being used in mattresses, or at least a law that require it to be listed in the material tags.