[Resolved] Secondary Menu in hook

Home Forums Support [Resolved] Secondary Menu in hook

Home Forums Support Secondary Menu in hook

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #800521
    Tim

    I am trying to get the secondary menu to display in the inside_mobile_header hook. I want the secondary menu to display in the header so that it can be sticky on top along with the header.

    Example: https://imgur.com/a/y5CFS3c

    The yellow bar would be the secondary menu.

    I got this:

    <div class="mobile-header-food-menu">
    <?php
    if (function_exists('has_nav_menu') && has_nav_menu('secondary')) {
    	
    } 
    ?>
    </div>

    That conditional evaluates to true. So all I need is the line of php that brings up the secondary menu. I have tried this:

    $nav_menu = array( 'title_li' => '', 'theme_location' => 'secondary' );
                        wp_nav_menu($nav_menu);

    I also tried submenu instead of secondary, both don’t bring up anything.

    How can I do this?

    Another solution would be to have the secondary navigation stick to the bottom of the header with css I guess, but I would prefer the first method.

    #800539
    Tim

    I think I have just found what I was after:

    generate_secondary_navigation_position();

    That was incredibly hard to find.

    #800541
    Leo
    Staff
    Customer Support

    Glad you figured out!

    That’s definitely the best way to do this 🙂

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.