Support » Themes and Templates » How to highlight current nav tab?

  • Resolved Jusi



    I’m creating a theme that will be used on several sites, with different number of pages etc. I want my navigation tabs to highlight when the reader is on that specific page, got ready “current” class, but can’t find the way to apply it to the dynamically created pages.

    I’m using wp_list_pages() template tag to create the ul with navigation, so every page made in backend will be displayed in navigation automatically. I saw a screencast by Chris Coyer but it requires the navigation to be hardcoded into the header.

    Is there any way to achieve the same effect using template tag to create navigation?


Viewing 3 replies - 1 through 3 (of 3 total)
  • In your style sheet try,

    #nav li.current_page_item a {YOUR DECLARATIONS}

    Of course change #nav to whatever DIV ID you’re actually using.

    Thank you, that was easier than I thought.
    Guess I should have taken a sneak peek into the code before 🙂

    Thanks again!

    hello lenk, how about my Home page. the code you wrote here only works for pages created in the dashboard.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to highlight current nav tab?’ is closed to new replies.