Hi. I am using the page system to create a series of pages for a client (obviously).
I have the pages dynamically generating a navigation menu using the <?php wp_list_pages(‘title_li=’); ?> tag.
So far it’s great. However, I need to generate an ‘on state’ for the current page in the nav menu. Right now the link it generates looks like this:
<li class=”page_item”> -a href=”http://mysite.com/?page_id=4″ title=”About Us”- About Us -/a-
What i need is to add a ‘onstate’ class to that ‘a’ tag if this is the current page.
I hope this makes sense. I am not a super great coder so please be gentle. Thanks again guys.
- The topic ‘“On-state” for current page in navigation’ is closed to new replies.