WordPress.org

Ready to get started?Download WordPress

Forums

Custom menus/headers for different categories (6 posts)

  1. enriquegarde
    Member
    Posted 3 years ago #

    Hello!

    I tried to find a solution for this, but I can't. My problem is that I have a template showing a header with a menu, but I need this menu to be different in each category, and if possible, edit different menus from the wp admin Menu options.

    I also tried to have different headers for writing a manual menu, but I don't know why can't I get it.

    An example of the site: http://www.cyanmag.com/revista/13/estilos-sofia-coppola-moda/

    Thank you very much!

  2. govpatel
    Member
    Posted 3 years ago #

    I think you can use Custom menu to do it

    Does your theme support custom menu if then
    create a menu
    and add click Appearance Menus and if you do not see your category box on left click on screen options and tick category now you will see category box add your categories to menu and then add your pages or posts in menu and arrange posts or pages by dragging and moving slightly to right under respective category as you wish.

  3. enriquegarde
    Member
    Posted 3 years ago #

    Hello,

    Thanks govpatel, but I think that answer is not exactly about what I was asking. I need one menu in one post (category A) and other different menu in other post (category B).

    Any ideas?

  4. teknohippy
    Member
    Posted 3 years ago #

    I've just done this by combining the new building menu menus with a custom field.

    In the theme I have:

    <?php wp_nav_menu( array( 'container' => 'none', 'container_class' => 'menu-header', 'theme_location' => 'primary', 'menu' => get_post_meta( $post->ID, 'MenuName', true) ) ); ?>

    Then in the page I simply have a custom field called "MenuName", which is set to match the name of the wordpress nav_menu I want used on that page.

    If a custom MenuName is not defined then it will fall back to the nav_menu assigned to that theme_location.

  5. Root
    Member
    Posted 3 years ago #

    That is very cool.

  6. Mika
    Member
    Posted 2 years ago #

    But how is possible to have two different navigation menus work for two different categories?

Topic Closed

This topic has been closed to new replies.

About this Topic