• I am working on my first attempt at a custom theme (it’s also my first time working with wordpress, jumped right in to the deep end basically). My general problem is that my menu will not show up. the black bar that holds it shows, but the menu itslef does not and I can’t figure out why; If you look at the code below you’ll see a UL with teh class of NAV, it doesn’t display/rendered as html and i cant’ figure out why

    HELP!

    <header>
    		<!--<h1><a href="<?php bloginfo('url');  ?>"><?php bloginfo("name");  ?></a></h1>-->
    		<!--<h1><?php bloginfo("description"); //Descript access tagline ?></h1>-->
    		<!-- navigation -->
    		<div class="navbar-wrapper">
    			<!-- Wrap the .navbar in .container to center it within the absolutely positioned parent. -->
    			<div class="container">
    
    				<div class="search">
    					<input type="text" name="namefield"  title="Name" class="required" id="name-field" placeholder="Search">
    				</div>
    
    					<div class="navbar navbar-inverse">
    						<div class="navbar-inner">
    						<!-- Responsive Navbar: Button for triggering responsive navbar. Include responsive CSS to utilize. -->
    						<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
    						  <span class="icon-bar"></span>
    						  <span class="icon-bar"></span>
    						  <span class="icon-bar"></span>
    						</button>
    						<a class="brand" href="index.php">GW Portrait Studios</a>
    
    							<!-- All collapsible elements within .navbar-collapse.collapse. -->
    							<div class="nav-collapse collapse">
    
    								<ul class="nav">
    									<?php wp_nav_menu($mainMenu); //menu is managed by defaults set above ?>
    								</ul> <!-- /.nav  end menu container -->
    
    							</div><!--/.nav-collapse -->
    						</div><!-- /.navbar-inner -->
    					</div><!-- /.navbar -->
    
    				</div> <!-- /.container -->
    			</div><!-- /.navbar-wrapper -->
    
    		<div class="clear"><a name="top"></a></div>
    	</header>
Viewing 7 replies - 1 through 7 (of 7 total)
  • What are the contents of $mainMenu? Perhaps one of the parameters is incorrect?

    Phil

    (@owendevelopment)

    Not to state the obvious, but have you enabled menu functionality in your functions.php file?

    if (function_exists('add_theme_support')) {
        add_theme_support('menus');
    }
    Thread Starter chezshire

    (@chezshire)

    I am trying to validate the CSS/HTML but this is my first time doing wordpress and the multiple parts make it very hard to find out what is coming from where.

    I’m not sure what you are asking vtzyzzy when you ask where contents are coming from, I believe they come from the menu which i did with the menu builder which is native to wordpress.

    But i do have the following code installed in the header of my file which i believe helps the menu and might be what you are asking Vtxyzzy:

    $mainMenu = array(
    		"theme_location" => "main_menu",
    		"container" => "nav",
    		"container_class" => "",
    		"container_id"=> "main_nav",
    		"depth" => 2 ); //Depth is how many levels of menu - main, child, subchild

    I do have theme support in my function file:
    add_theme_support('post-thumbnails'); //featured image

    Thank you for the suggestions, i’m hoping to get this resolved. i’d just like to get the drop downs to work, that would be so nice.
    Thank you.

    Yes, that is exactly what I was asking. Now, you have ‘”theme_location” => “main_menu”,’ in $mainMenu.

    In order for that to be accessed, you must have ‘main_menu’ registered by calling ‘register_nav_menu( ‘main_menu’, ‘Main Menu’ );`,
    and you must select a Custom Menu in the ‘Theme Locations’ box on the left of the Admin->Appearance->Menus panel.

    Thread Starter chezshire

    (@chezshire)

    Thank you for the Guidance vtxyzzy, I will try that as soon as I get home and report back positively or negatively as to how the results panned out for me. And again Thank you.

    Thread Starter chezshire

    (@chezshire)

    Hi Vtxtzzy,
    I tried to do what suggested and i received a php error. Right now i’m using a plugin called WP Bootstrap menu to get my first level (parent) to show. I tried adjusting things and the whole menu stopped displaying.

    ??

    I am not familiar with that plugin, so I can’t offer further help on the topic.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘My NavBar No Like Me’ is closed to new replies.