Body ID’s & Active Navigation
-
I’m creating a custom theme which requires a body id for each section. So, for example, on the home page the body id would be <body id=”home”>, archives page <body id=”archives”> etc.
I’ve included the <body> tag in my header but I’m not sure if this is the best way to do this because it needs to change for each section. The reason for the body id is for active navigation items. So “Home” is highlighted when they are on the home page, “Archives” is highlighted when they are on the archives page, etc.
Can anyone suggest how I may implement this? I have the CSS done already I just need to know how to link it up to WordPress to create the effect. Whether it should be in the index.php file or header.php or whether I need any other code.
Thanks.
- The topic ‘Body ID’s & Active Navigation’ is closed to new replies.