• i am trying to add a menu locations/adjust the default menu at the top right.

    Specifically, i am trying to move the primary menu to the left side, that will still collapse to the hamburger on mobile, and a right side set of links that will include social and logon options along with a foxy-cart cart inventory widget, that would still be at the top of the screen (under the hamburger) on mobile.

    I have been walking through the PHP files, and found the function call bento_primary_menu() in the header.php file, but can not seem to locate the actual function.

    or if there is an easier way to achieve this, i am open to that as well.

    Regards,

    Kevin

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Theme Author satoristudio

    (@satoristudio)

    Hey Kevin,

    thanks for choosing Bento!

    The bento_primary_menu() function is defined on line 69 of the /includes/template-tags.php file (in general that’s where all similar rendering functions live in Bento, as per WP coding best practices). When you make changes to the theme’s php, make sure to do it via a child, otherwise they will be overwritten after the next Bento update.

    • This reply was modified 6 years, 11 months ago by satoristudio.
    Thread Starter mistaken

    (@mistaken)

    Thank you. . .

    now i am even more lost than i was before. I expected to go to this location and find html and maybe some controlling php for deciding which type of menu layout had been selected from the customize settings.

    instead i find

    wp_nav_menu(

    array(

    ‘theme_location’ => ‘primary-menu’,

    ‘depth’ => $depth,

    ‘menu_class’ => ‘primary-menu’,

    ‘container_class’ => ‘menu-container’,

    ‘link_before’ => ‘<span class=”menu-item-inner”>’,

    ‘link_after’ => ‘</span>’,

    ‘fallback_cb’ => ‘false’,

    )

    inside a id=nav-primary. I am guessing that some of those variables are are loading from settings pulled in from some where else.

    can you give me a clue where/how i might look either add or modify where the existing location is.

    Thread Starter mistaken

    (@mistaken)

    if any one else ever needs this answered

    find this line in the ‘templates-tags.php’

    in the ‘bento_primary_menu’ function

    <div id=”nav-primary” class=”nav”>

    remove the ‘nav-primary’ id, this appears to be how the location of the menu is controlled. now you can use a class or other id to style to your own needs.

    Theme Author satoristudio

    (@satoristudio)

    Thank you for sharing, Kevin, much appreciated!
    An alternative solution would be to change the container_class parameter in the function you pasted above – this will change/add the class of the menu container, which can then be used for CSS styling.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘bento_primary_menu() location’ is closed to new replies.