• Resolved akacruiseman

    (@akacruiseman)


    Hey there,
    Suggestion: This may be in the works but would it be possible for the theme to support more than One (1) menu?
    This is the message I get in the Admin area:
    “Your theme supports 1 menu.”

    Here

Viewing 6 replies - 1 through 6 (of 6 total)
  • Theme Author nobita

    (@nobita)

    Hi akacruiseman

    Do you want to add a menu to which part?

    Thank you.

    Thread Starter akacruiseman

    (@akacruiseman)

    Good Day,
    I was trying to add another menu in the Theme Navigation across the top.
    When you view the site there is only the One menu, Drop Down, at that location.

    http://www.bradenrivervfw.org/

    Thanks,
    Jim

    Theme Author nobita

    (@nobita)

    Thread Starter akacruiseman

    (@akacruiseman)

    Hi,
    Doing the Menus like you show is the usual navigation menu layout.

    I am trying to do Drop Down menus without adding a plugin but by using the WP menus.

    Thanks for looking.
    Jim

    Theme Author nobita

    (@nobita)

    Try below

    Add functions.php following PHP code

    register_nav_menus( array( 'secondary' => esc_html__( 'Secondary Navigation', 'Raindrops' ), ) );
    add_filter( 'raindrops_embed_meta_css','raindrops_secondary_navigation_style' );
    add_action( 'raindrops_prepend_doc', 'raindrops_secondary_navigation' );
    add_filter( 'script_loader_tag', 'my_script_loader_tag', 10, 3 );
    
    function raindrops_secondary_navigation(){
    	$defaults = array(
    		'theme_location'  => 'secondary',
    		'container'       => 'div',
    		'container_class' => 'secondary-nav-menu',
    		'menu_class'      => 'menu',
    		'menu_id'         => 'secondary-memu',
    		'echo'            => true,
    		'fallback_cb'     => '',
    		'before'          => '<span class="item-wrapper gradient-1">',
    		'after'           => '</span>',
    		'items_wrap'      => '<ul id="%1$s" class="%2$s" role="navigation">%3$s</ul>',
    		'depth'           => 0,
    	);
    	wp_nav_menu( $defaults );
    	echo '<br class="clear" />';
    }
    function raindrops_secondary_navigation_style( $css ) {
    
    $custom_css = '
    .secondary-nav-menu{
        box-sizing:border-box;
        min-height:1%;
        display:block;
        position:relative;
        height:3.2em;
    }
    .secondary-nav-menu ul,
    .secondary-nav-menu li{
        margin:0;
        padding:0;
    }
    
    .secondary-nav-menu > .menu  li{
       float:right;
       z-index:1000;
       list-style:none;
       position:relative;
    }
    
    .secondary-nav-menu .children,
    .secondary-nav-menu .sub-menu{
        display:none;
    }
    
    .secondary-nav-menu ul ul li ul li,
    .secondary-nav-menu li:hover > .children > li,
    .secondary-nav-menu li:hover > .sub-menu > li{
        width:100%;
        text-align:left;
        box-sizing:border-box;
    
    }
    
    .secondary-nav-menu li.menu-has-children:hover ul,
    .secondary-nav-menu li:hover > li,
    .secondary-nav-menu li:hover > .children,
    .secondary-nav-menu li:hover > .sub-menu{
        display:block;
        position:absolute;
        z-index:1000;
        width:100%;
        margin-left:0;
        left:0;
    }
    
    .secondary-nav-menu ul ul li ul li{
        display:block;
        position:absolute;
        z-index:1100;
        width:100%;
        margin-left:0;
        right:100%;
        top:-3.2em;
    }
    .secondary-nav-menu .item-wrapper a,
    .secondary-nav-menu .item-wrapper{
        display:block;
        width:100%;
        height:100%;
        padding:.5em;
        box-sizing:border-box;
    }
    
    .secondary-nav-menu .item-wrapper{
    	border:1px solid rgba(0,0,0,.1);
    }
    /* keyboard accessibility  .focus support raindrops-helper.js */
    
    .secondary-nav-menu ul ul li ul li.focus,
    .secondary-nav-menu li.focus > .children > li,
    .secondary-nav-menu li.focus > .sub-menu > li{
        width:100%;
        text-align:left;
        box-sizing:border-box;
    }
    
    .secondary-nav-menu li.menu-has-children.focus ul,
    .secondary-nav-menu li.focus > li,
    .secondary-nav-menu li.focus > .children,
    .secondary-nav-menu li.focus > .sub-menu{
        display:block;
        position:absolute;
        z-index:1000;
        width:100%;
        margin-left:0;
        left:0;
    }
    /* menu list color */
    .item-wrapper{
        background:#333;
        color:#fff;
    }';
    	return $css.$custom_css;
    }
    /* keyboard accessibility helper script */
    
    function my_script_loader_tag( $tag, $handle, $src ) {
    
    	$script = "jQuery( '.secondary-nav-menu' ).find( 'a' ).on( 'focus.raindrops blur.raindrops', function ( ) {
    
                    jQuery( this ).parents( ).toggleClass( 'focus' );
                } );
                jQuery( '.secondary-nav-menu' ).on('mousemove','a', function(){
                   jQuery( this ).toggleClass('focus').parents( ).children().removeClass('focus');
                });";
    
    	if ( $handle == 'raindrops_helper_script' ) {
    		return $tag . '<script>'. $script. '</script>' . "\n";
    	}
    	return $tag;
    }
    ?>

    Thread Starter akacruiseman

    (@akacruiseman)

    Hi nobita,
    Added the code with these results.
    1 – Does not show the Secondary Menu
    2 – The function.php was changed within comments that started with

    /**
    * Added 3-17-2015 - Jim
    */

    The page loaded fine.

    3 – I was able to work with the “Menu” and put into it what I wanted.
    In the Customize are of the theme it shows both the Primary and Secondary menus. It DOES NOT show any settings for the Secondary (Menu Primary Font Size & Menu Primary Min Width) but it DOES show those two settings for the Primary.

    4 – Manage Locations in the Menus section also shows both Primary and Secondary.

    I received NO error codes or conditions.
    We are close nobita.
    Thank you very much.
    Jim

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘More than one menu’ is closed to new replies.