Add post/page name + page parent name to body class
WordPress Tips & TricksThis will add a page-slug class and a page-parent-slug class to your body tag, along with all the other defaults. Put this in your functions.php file:
Also make sure your open body tag looks like this (you can probably find it in header.php):
Many thanks to Utkarsh Kuketri for the original function!







