WordPress body_class()

If page IDs or other classes are not appearing in the source code for a site that you’re working on, check the header.php file to see if body_class(); is being applied to the <body> tag.

This will auto-generate all of the relevant classes needed for the page that you’re viewing: page id, template name, etc.

Sourced here.

Leave a Reply

katherine as a flat graphic icon

About Me

I’m an African / Ojibwe First Nations Web Developer living in Winnipeg, Manitoba.

Visit the Tips and Blog to see what I’m working on.