tcherokee
Member
Posted 5 years ago #
I wanted to find out if there is a way of assigning body id based on the page that you are on. For example, if you navigate to the about page, the body id will become <body id=about-page>.
The reason I want to do this is because I'm using a css navigational system that relies on the body id to display the a hover and active states.
Thanks in advance for your assistance
Why not just use this.
<ul>
<?php
$pg_li="page_item";
if (is_home()) {$pg_li .=" current_page_item";}
?>
<?php wp_list_pages('title_li='); ?>
</ul>
Then whenever the link in the menu is the current page then the class current_page_item is applied to that link then you can style that class any way you want. Just a thought.
tcherokee
Member
Posted 5 years ago #
Thanks, gotten it to work :)