WordPress.org

Ready to get started?Download WordPress

Forums

Add class/other to "current" menu item, wp_nav_menu() (3 posts)

  1. tommygeorge
    Member
    Posted 4 years ago #

    Haven't been hacking in quite some time. Very excited about Menus and Types, but have this question:

    Given a Pages list, or perhaps a new custom menu, how can I add an HTML class or wrap the given item somehow, for the "current" page.

    IE, I on the Pages list/menu, if my users are viewing the "about" page, I'd like to add a 'current' class/style to the "About" page menu item.

    What hook should I be looking at, or is this not implemented yet?

    Thanks!

  2. tommygeorge
    Member
    Posted 4 years ago #

    This is accomplished via http://codex.wordpress.org/Template_Tags/wp_list_pages#Markup_and_styling_of_page_items

    ... for Page menus.

    Is there similar code in place for custom Menus? What are the classes?

  3. Fran6
    Member
    Posted 4 years ago #

    I am looking for a solution too. I can highlight different pages without a problem but I don't know how to do it for the homepage. To display the home page I created a custom page which does not have any "current" class...

    Any help here ?

Topic Closed

This topic has been closed to new replies.

About this Topic