WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to highlight current nav tab? (4 posts)

  1. Jusi
    Member
    Posted 5 years ago #

    Hello.

    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?

    Justine

  2. Len
    Member
    Posted 5 years ago #

    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.

  3. Jusi
    Member
    Posted 5 years ago #

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

    Thanks again!
    Justine

  4. lhoylhoy
    Member
    Posted 5 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.