Working with templates in WordPress is something that’s not uncommon. Everything is a template of sorts – from the main page template, single page template, 404 template – all the way to custom templates.
Sometimes, though, you may want to apply a class to the body element based on the template that’s being used so that you can style this particular template a bit differently than the rest of the site.

Though you can do it in a number of different ways, to do it we all have our methods so I thought I’d share mine.




