WordPress.org

Ready to get started?Download WordPress

Forums

Custom horizontal menus displayed on specific pages (11 posts)

  1. kirkearl
    Member
    Posted 1 year ago #

    I'm re-building an existing website in WP. No problem there.

    My company sends out monthly newsletters. I'd like to be able to display a different horizontal menu specific to the newsletter pages. I've created both menus. I'm using twenty twelve

    I've encountered some solutions that worked partially. I was able to get my newsletter menu to display on a specific page but the main nav menu was still visible. (did this via editing header.php)

    I know there are some newsletter plug-ins that involve signing-up and RSS feeds and such but I have no need for these things. I send out html emails via listserv with links to the live newsletter.

    I'm trying to avoid buying a plug-in like UberMenu. I'm trying to avoid using any plug-ins at all for this but any help would be much appreciated!

  2. deepbevel
    Member
    Posted 1 year ago #

    I ended up using a single custom menu, but different menu items depending on the page. Just add a class to the item you want to hide or show, then use your class in style.css like this:

    .your-menu-item-class {
        display: none;
    }
    .page-id-1 .your-menu-item-class {
        display: block;
    }
  3. ottomek
    Member
    Posted 1 year ago #

    I too am wondering how to have a different horizontal menu on different pages.

    Thoughts?

  4. deepbevel
    Member
    Posted 1 year ago #

    You could use css like I did, you just have to add a class to the custom menu items.

    if you want to go this route just let me know if you have specific quesitions about it..

  5. ottomek
    Member
    Posted 1 year ago #

    This project is going to have over 100 pages and lots of admins adding/changing pages that don't have css knowledge. I was hoping to just have a template or use widget logic for easy display of 4 different menus depending on the section of website viewed.

  6. cgrray
    Member
    Posted 1 year ago #

    Did you ever find a solution to this?

  7. deepbevel
    Member
    Posted 1 year ago #

    http://wordpress.org/extend/plugins/if-menu/
    lets you show different menus based on role, as well as other conditions. Still the user would have add the pages to the menu, although I think you can select "auto add new top level pages" to the custom menus. So maybe that would work for you?

  8. deepbevel
    Member
    Posted 1 year ago #

    actually, I doubt wp would assign the page to the correct menu based on the role set by the plugin. Chances are users would still have to vist the menus setting page.

  9. ottomek
    Member
    Posted 1 year ago #

    I couldn't find a plugin that would do what I wanted but I got it to work here, it requires some customization: http://www.recreationnorthwest.org/

    Each of the 3 events have their own Menu.
    I had to register the 3 new menus in my functions.php so they would show up as options in the WP Menu area.

    I created a unique page template and header for each event. Then I told each header to reference the appropriate menu for it's menu.

    Then assigned each page to the appropriate template. Now the Kids Traverse has the Kids menu being shown via the Kids-page.php and header-Kids.php

    Same for the Olympia event and Bellingham event.

  10. cgrray
    Member
    Posted 1 year ago #

    That's exactly what I want but I'm afraid I don't know how to do what you suggest. Is there any chance you could give me examples of what you did to which files?
    I only need one additional menu.
    Thanks.

  11. deepbevel
    Member
    Posted 1 year ago #

    this appears to possibly accomplish the same but with custom fields.
    Users would have to select a field, which gets the appropriate menu for the page or post.
    Otherwise all that's required is a template tag.

Topic Closed

This topic has been closed to new replies.

About this Topic