Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End [WP] Sub nav functionality with wp_nav_menu

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #29754
    calebkester
    Member

    So I’m still trying to get the hang of the new wp_nav_menu .

    I’m trying to get it be used in a subnavigation through one menu for the whole site. The reason for this is I’d rather just deal with changing the navigation/page order in one place as opposed to multiple places. The main navigation menu works just fine after I use depth -> 1, the problem is with the sub menu.

    Code:
    – Page A

    – Page B

    – Page 1

    – Page 2

    When the user selects a page, the submenu should only show what’s under that category. I don’t want Page A showing up if page 1 is selected. Is it possible to do with just one navigational menu? Or do I need to register more menus? Or should I go through and use wp_page_menu .

    Thanks!

    #80588
    jamygolden
    Member

    Check out the body class on the "page 1" page. If it has a unique one such as <body class="page-1 etc.etcetc."> you could add the following to your css:

    Code:
    body.page-1 ul li.page-A{display: none;}

    There are a few methods to adding custom classes to the body tag if you can’t do it already. Chris did one somewhere if I’m not mistaken.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Back End’ is closed to new topics and replies.