• Resolved Phillip Dews

    (@phillipdewsblogger)


    got a weird problem! I am creating a theme for a new client and I cannot get the menu to show up on the public side of the site!
    On the admin backend under apperance > menus it works perfectly!
    I am also using the exact same wp_menu array I have used in all of my themes.
    I have also set up the wp_menu function in my functions.php page! For those that want to see it here is my code…

    <nav class="top-links" role="navigation">
    <?php wp_nav_menu(array(							'menu'	=> 'primary',
    	'theme_location' => 'primary',
    	'depth'	=> 2,
    	'container' => 'div',
    	'container_class' => 'top-links-nav',
    	'fallback_cb' => 'wp_bootstrap_navwalker::fallback',
    	'walker' => new wp_bootstrap_navwalker())
    	);
    ?>
    </nav>

    and here is the function

    /* Register the Nav Menu */
    function register_my_menus() {
    	require_once('wp_bootstrap_navwalker.php');
        register_nav_menus(array(
    		'primary' => _( 'Primary Menu' ),
            'header-top-menu' => _( 'Header Top Menu' )
    	));
        }
    add_action( 'init', 'register_my_menus' );
    /* End the Nav Menu */

    Many thanks in advance

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    Does this happen if you deactivate all plugins?

    Try using after_setup_theme rather than init for the hook and see if that helps.

    Thread Starter Phillip Dews

    (@phillipdewsblogger)

    Thanks Jose,

    got it all sorted now anyway!
    Many thanks for your reply though!

    Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    Great!

    What was it just in case anybody else has that same issue? 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WP Menu Problem’ is closed to new replies.