Forums

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

Home Forums Other WordPress Multiple Menus

  • This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #30926
    Jacek
    Member

    I have been asking Mr Google for help but hours spent in front of the screen didn’t solve my problem clearly (by which I mean I’m a beginner and understand simple language only ;))

    I have a WP website with a menu at the top (ex. 1, 2, 3, 4)
    I would like to have a separate menu (5, 6, 7, 8) when I’m on page 4.

    Do you know any simple way of going about it? :)

    #70453
    TheDoc
    Member

    You want to change your main navigation when you switch pages? Simply due to usability I highly recommend you not do that.

    But perhaps I’m not understanding you correctly! Perhaps you want a sub-navigation to show under it?

    #70432
    Jacek
    Member

    You understand what I mean – I want a different navigation when I switch pages.

    To make it clear – it is a page of a local church and I want a subpage for the youth ministry. This is why I want to change the navigation from the main to one connected with the youth only (separate gallery, news, etc.) and still I want it to work under the same domain and layout.

    Any ideas?

    #69947
    Jacek
    Member

    And what about a conditional?

    #69949
    Jacek
    Member

    For example:

    
    if ( is_page('page_with_second_menu') ) {wp_nav_menu('menu' => 'menu-second-whatever-the-name-is');

    }
    ?>

    I have come across such things and I’m wondering how to make it work.

    #69859
    cjk
    Member

    Custom post types?

    That second section could be custom post types yeah?

    Codex

    So, you could set up a custom post type for your youth pages, a “single-type” template for custom posts and then call a custom header.php from that custom post single template that contains the navigation menu.

    Whenever a post is made by youth, it will be made on the custom post type “youth” (not page, or post, there will be a new option in the dashboard for “youth” posts or whatever you decide to call it) .

    Hope this makes sense to you.

    #65437
    Jacek
    Member

    It makes sense but I still have no idea how to go about it ;)

    #65272
    Jacek
    Member

    I made it!

    1. I added a new menu in functions.php in my theme.
    2. Then I created a new template (by simply copying page.php) where I replaced the name of the menu with the new one.
    3. Finally using Appearance -> Menu I created a new menu and in widgets I used my new custom menu.

    Now when I use any page connected with the youth I simply use the template.

    That was all I needed and didn’t know it could be that simple :)

    Thank you all for your help!

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