Where/how to edit mobile menu on custom-coded site

Viewed 21

I am looking to update a link in the mobile hamburger menu on a custom-coded website that uses custom fields. I want a menu item to link to a pdf instead of a #section (one-page site).

I have scoured the code and can't find where the actual links are to change them. FYI I am not a code-warrior - sorry in advance.

The main menu is managed through the menu section of the Wordpress site, while the mobile menu is not. When I update the main menu links, the mobile menu links do not change. I am guessing it has something to do with this snippet of code (because when I remove it, the menu disappears) but I can't find the source.

<a href="javascript:showMenu();" id="mobile-menu"><span></span></a>

Any thoughts on how I can edit the mobile menu links OR get the main menu to control the mobile menu?

Partial code from header.php:

    <header id="masthead" class="site-header" role="banner">
    <div class="inner">
        <div class="header-top">
            <ul class="socials">
                <?php if(get_option('mytheme_fb')): ?><li class="fb"><a href="<?php echo get_option('mytheme_fb'); ?>" target="_blank">Facebook</a><em></em></li><?php endif; ?>
                <?php if(get_option('mytheme_twt')): ?><li class="twt"><a href="<?php echo get_option('mytheme_twt'); ?>" target="_blank">Twitter</a><em></em></li><?php endif; ?>
                <?php if(get_option('mytheme_instagram')): ?><li class="instagram"><a href="<?php echo get_option('mytheme_instagram'); ?>" target="_blank">instagram</a><em></em></li><?php endif; ?>
            </ul>
            <div class="reservation-contact">For groups of 10+ please call <a href="tel:7807571114">780-757-1114</a></div>
            <div class="header-btns">
                <a href="<?php echo get_option('mytheme_reserv'); ?>" class="reservation" target="_blank">MAKE A RESERVATION</a>
                <a href="http://sabordivinorestaurantlounge.fbmta.com/members/UpdateProfile.aspx?Action=Subscribe" class="reservation join" target="_blank">JOIN OUR MAILING LIST</a>
            </div>
        </div>
        <div class="site-logo"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></div>
        <a href="javascript:showMenu();" id="mobile-menu"><span></span></a>
        <nav id="site-navi" class="main-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Primary Menu', 'Sabor' ); ?>">
            <?php
                wp_nav_menu( array(
                    'theme_location' => 'primary',
                    'menu'     => 'Main menu',
                 ) );
            ?>
        </nav><!-- .main-navigation -->
2 Answers

This "code" causes a fatal error: Call to undefined function wp_nav_menu()

            wp_nav_menu( array(
                'theme_location' => 'primary',
                'menu'     => 'Main menu',
             ) );

ShowMenu() is a javascript function. Showing php and html code won't answer your question

Related