• Resolved goldmember

    (@goldmember)


    i’m using this theme on a new version of a site that i’m building here.

    my problem is that i created a menu called “topnavmenu”.

    then, as instructed in every tutorial i read, i added this to the functions.php file:

    if ( function_exists( 'register_nav_menu' ) ) {
    	register_nav_menu( 'topnavmenu', 'topnavmenu' );
    }

    then i added this to the header.php file

    <div class="menu">
    				<ul>
    					<?php wp_nav_menu( array('menu' => 'topnavmenu' )); ?>
    				</ul>

    yet no menu appears at the top of the site?! what am i missing?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello,

    First of all, take away your ‘ul’ tags. WordPress generates these automatically.

    Within your header.php change what you have to the following:

    <?php wp_nav_menu( array('theme_location' => 'topnavmenu')); ?>

    Next, go to appearance > menus and create a menu then save it. Then in the top left corner assign the newly created menu to the ‘topnavmenu’.

    This should then display.

    Thread Starter goldmember

    (@goldmember)

    thanks. that worked!

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

The topic ‘custom menu not working’ is closed to new replies.