How to add category id to WordPress body and post class

This snippet is very handy if you wish to add the category ID to the body or post class for ex. targeting CSS styles and such.

Add this to your functions.php file.


Leave a Reply

Your email address will not be published. Required fields are marked *