Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Wrong Menu Displaying in Primary Location WordPress

  • SOLVED

http://feedingsga.org

I have a menu "Main Navigation" that should (and used to) display in the Primary location (under the heading/logos). Now a different menu (the "Connect" menu from the footer) is in that spot.

I have gone to Appearance->Menu in the dashboard, and the Main Navigation menu is checked to be in the Primary location. The "Connect" footer menu is not. I don't know what else to do.

Answers (1)

2015-01-09

Arnav Joy answers:

can you show us your header.php file?


Anne Shenton comments:

<?php
/**
* The Header for our theme.
*
* Displays all of the <head> section and everything up till <main id="main">
*
* @package secondeharvest
*/
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width">
<title><?php wp_title( '|', true, 'right' ); ?></title>
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">

<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/css/bootstrap.min.css">
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="<?php echo get_template_directory_uri(); ?>/css/bootstrap.min.js"></script>

<?php wp_head(); ?>
<!--[if gt IE 6]>
<style>
input.cust-text-field { height: 36px !important; }
</style>
<![endif]-->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/selectivizr/1.0.2/selectivizr-min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/respond.js/1.2.0/respond.min.js"></script>
<![endif]-->

</head>

<body <?php body_class(); ?>
<div id="page" class="hfeed site">
<!-- ================================================== LOGO ================================================== -->
<div class="row logo white">
<div class="container">
<div class="col-sm-12 col-md-12 col-xs-12 container">
<div class="site-branding col-sm-3 col-md-4 col-xs-7 logo-small cust-header">
<h1 class="site-title"><a class="logo-left" href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img src="<?php echo get_template_directory_uri(); ?>/images/feeding-logo.png" alt="Second Harvest of South Georgia"></a></h1>
</div>

<div class="col-sm-3 col-md-3 col-xs-5 pull-right logo-right">
<img class="logo-right" alt="logo-right" src="<?php echo get_template_directory_uri(); ?>/images/feeding-america-logo.jpg" alt="Feeding America">
</div>
</div><!--end logo-->
</div>
</div>

<!-- ================================================== Navigation ================================================== -->

<div class="row gray-border">
<div class="container ipad-container">
<div class="row cust-row">
<div class="nav-top col-md-12">
<nav class="main-navigation col-sm-12 col-md-12" role="navigation">
<h1 class="menu-toggle"><?php _e( 'Menu', 'second-harvest' ); ?></h1>
<div class="screen-reader-text skip-link"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'second-harvest' ); ?>"><?php _e( 'Skip to content', 'second-harvest' ); ?></a></div>
<?php wp_nav_menu( array( 'theme_location' => '', 'container' => '', 'items_wrap' => '<ul class="list-inline">%3$s</ul>') ); ?>
</nav><!-- #site-navigation -->

<!-- Mobile Nav -->
<div class="navbar navbar-default">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<?php $items = wp_get_nav_menu_items( 49 ); ?>
<?php foreach($items as $item){ ?>
<li> <a href="<?php echo $item->url; ?>"><?php echo $item->title; ?></a></li>
<?php } ?>
</ul>
</div>
</div>

</div>
</div>
</div>
</div>

<!-- ================================================== BANNER ================================================== -->

<header id="masthead" class="site-header container" role="banner">
<?php if(is_front_page()){ ?>
<div class="row">
<div class="col-md-12">
<div class="bannerarea">
<?php echo do_shortcode("[metaslider id=850]"); ?>
</div>
</div>
</div>

<!-- ================================================== NAVIGATION BOTTOM ================================================== -->
<div class="row nav-bottom cust-row-bottom">
<div class="col-xs-12 col-md-12">
<div class="col-sm-4 col-md-4">
<div class="row">
<a href="donate-foods">
<div class="col-xs-6 col-md-6 nav-bottom-icon">
<img class="cust-corn" src="<?php echo get_template_directory_uri(); ?>/images/corn.png">
</div>
<div class="col-xs-6 col-md-6 cust">
<p class="nav-top-text">Donate</p>
<p class="nav-bottom-text1">Food</p>
</div>
</a>
</div>
</div>
<div class="col-sm-4 col-md-4">
<div class="row">
<a href="http://www.volgistics.com/ex/portal.dll/ap?AP=780025940">
<div class="col-xs-6 col-md-6 nav-bottom-icon vol">
<img src="<?php echo get_template_directory_uri(); ?>/images/volunteer.png">
</div>
<div class="col-xs-6 col-md-6 cust">
<p class="nav-top-text participate">Participate</p>
<p class="nav-bottom-text2">Volunteer</p>
</div>
</a>
</div>
</div>
<div class="col-sm-4 col-md-4">
<div class="row">
<a href="donate-fund">
<div class="col-xs-6 col-md-6 nav-bottom-icon">
<img src="<?php echo get_template_directory_uri(); ?>/images/funds.png">
</div>
<div class="col-xs-6 col-md-6 cust">
<p class="nav-top-text">Give</p>
<p class="nav-bottom-text3">Funds</p>
</div>
</a>
</div>
</div>
</div>
</div>
<?php } ?>
</header><!-- #masthead -->

<div id="content" class="site-content container">


Arnav Joy comments:

see this line

<?php wp_nav_menu( array( 'theme_location' => '', 'container' => '', 'items_wrap' => '<ul class="list-inline">%3$s</ul>') ); ?>

you have to add 'primary' to 'theme_location'

like

<?php wp_nav_menu( array( 'theme_location' => 'primary', 'container' => '', 'items_wrap' => '<ul class="list-inline">%3$s</ul>') ); ?>

Please note that it is not necessary that this will be primary , it can be different also check your functions.php file for correct name of Primary Menu