Add a Class to my Body Tag using the Forum Title
I’m trying to build a theme for my BBpress site and I would like to add a class to my body tag that changes depending on where the user is within the forum but only for within a forum area.
For instance… On my BBpress installation, if I have these forums:
If the user view topics within the ‘Green’ forum/sub-forum it add the classname ‘green’ to the body tag i.e “<body class=”green”>” I would like it to use the Forum’s title that is set. Can somebody help?
Preferably the code to be in functions.php or header.php / bbpress theme files. I don’t want to hack the bbpress core files.
I want to do this so I can change the way it looks i.e background colour etc.
And the Homepage stays the same: <body> (with no classname unelss set within the header.php of the theme file.
You must be logged in to reply to this topic.