I'm a newbie, to wordpress, stackoverflow and php and am trying to build an original theme in wordpress.
I have set up my main menu under the name 'Standard Menu', which i've specified both in the admin menu panel, functions.php and header.php, but my submenu's are not being generated. I've checked the depth and it's set to three (3). I've googled for a few hours but all solutions that I find have to do with css or html issues (something is generated and it is not showing up correctly) vs. something is not being generated. I've checked my menu and it's named correctly, it has three levels of menu (Parent, Child, Grandchild), but only the parent is generated.
I am using bootstrap, but i don't believe that this is/has anything to do with my CSS, rather its that wordpress isn't outputting the child elements (submenu).
Here is the associative array which is lines 1-10 of my header file:
<?php
// Create associative array
$mainMenu = array( //format parameters for menu(s) in header/sidebars/things
"theme_location" => "Standard Menu", //
"container" => "", //
"menu_class" => "dropdown-menu",
"container_class" => "", // left empty, could be container_id;
"container_id"=> "main_nav",
"depth" => 3 ); //Depth is how many levels of menu - main, child, subchild
?>
Here is the head portion of the header code, lines 54 -79:
<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="navbar">
<div class="navbar-inner">
<div class="container">
<a class="homelink" href="<?php bloginfo('url'); ?>"><?php bloginfo("name"); ?></a>
<ul class="nav">
<?php if (function_exists('getNavMenu')): ?>
<?php echo getNavMenu('Standard Menu'); ?>
<?php endif; ?>
</ul>
</div>
</div>
</div>
</div><!-- /.navbar-wrapper -->
<div class="clear"><a name="top"></a></div>
</header>
here is the functions file:
<?php
/* Hi Portia - There is a kitty hidden somewhere in this theme - enjoy! */
//register_nav_menu("main_menu", "Main Navigation Menu");
/* How to remove 'tight' coupling in menu dashboard */
// ..._menu for one or menus for more then one
// first name -> used to call menu in script/code
// second name -> used by dashboard
$menuList = array (
//Changed 'Menu' to 'Standard Menu' to match admin menu panel/header
"main_menu" => "Standard Menu", // name based on usability
"util_menu" => "Util Menu: Upper Right", //Named where it appears
"footer_menu" => "Footer Menu: Bottom"
);
register_nav_menus($menuList);
/* =====----- Adds login/logout link to nav -----+++++ */
add_filter('wp_nav_menu_items', 'add_login_logout_link', 10, 2);
function add_login_logout_link($items, $args) {
ob_start();
wp_loginout('index.php');
$loginoutlink = ob_get_contents();
ob_end_clean();
$items .= '<li class="login" '. $loginoutlink .'</li>';
return $items;
}
/* =====----- LOAD CSS -----+++++ */
//function artisan_load_styles() {
//if (!is_admin()) {
//wp_enqueue_style('main', get_template_directory_uri() . '/style.css');
//wp_enqueue_style('bootstrap', get_template_directory_uri() . '/_css/bootstrap.css');
//wp_enqueue_style('responsive', get_template_directory_uri() . '/_css/bootstrap-responsive');
//wp_enqueue_style('ieSucks', get_template_directory_uri() . '/_css/ieresp.css');
//wp_enqueue_style('base', get_template_directory_uri() . '/_css/base.css');
//}
//}
//add_action('get_header', 'artisan_load_styles');
?>
URL: Wordpress site