hey guys I’m new to wordpress theme development and having problem with active page.
this is code of my header.php
Please help me how to do this :)
< ?php wp_list_pages('title_li=&depth=1&exclude=5,6,7,8,9,10,11'); ?>
code in next post -_-
here is the codepen link to my header.php file
Not quite sure what you’re looking to accomplish functionality wise, but I’d recommend using wp_nav_menu() for your navigation. The old exclude rodeo from wp_list_pages makes me cringe every time I see it.
[TutsPlus - Function Overview](http://wp.tutsplus.com/tutorials/creative-coding/function-examination-wp_nav_menu/ “TutsPlus – Function Overview”)
[WP Codex - Function Reference](http://codex.wordpress.org/Function_Reference/wp_nav_menu “WP Codex – Function Reference”)
What i want is that When Home page is open the “Home” option in navigation bar should be highlighted
when Contact page is open the “Contact” option should be highlighted
To get this to work with my [website](http://stevenwatson.co.uk/about “”), I had to add a class to my CSS file called;
`current_page_item` and add the styles within this, I however used the Starkers Barebones theme.
Hope this helps…
Watson is right, wordpress adds a default class “current_page_item” to the current page, So you can write your css for it.
Thanks for the Help guys. It worked :)
Good to hear :)
You must be logged in to reply to this topic.