Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8680019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:08:25+00:00 2026-06-12T21:08:25+00:00

I am using a blank theme template to create a wordpress theme and I

  • 0

I am using a blank theme template to create a wordpress theme and I enabled menus by adding the below code to header.php:

<body <?php body_class(); ?>>
    <div id="navbar"></div>

    <div id="wrapper" class="clear">

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

        </nav>

And I added this to functions.php:

if (function_exists('register_nav_menus')) {
    register_nav_menus(
        array(
            'main_nav' => 'Main Navigation Menu'
            )
        );
};

The menu shows up and works fine when I add links to pages but when I add a custom link to say http://www.google.com with the label Google nothing shows up in the navigation bar. When I view the source the custom link is not being populated at all.

testing with google.com

<nav>                  
       <div class="menu">
          <ul>
              <li class="page_item page-item-9"><a href="http://localhost/wordpress/anatomy/">Anatomy</a></li>
              <li class="page_item page-item-11"><a href="http://localhost/wordpress/history/">History</a></li>
              <li class="page_item page-item-7"><a href="http://localhost/wordpress/home/">Home</a></li>
          </ul>
       </div>
</nav>

My css for the nav is simple:

    nav {
    padding:0;
    margin:0;
    position:absolute;
    width: 900px;
} 
nav ul li
    {list-style: none;
    font-family: 'Numans', sans-serif;
    font-size: 15px;
    color: #ffffff;
    text-align:left;
    text-transform: uppercase;
    padding: 0;
    margin: 0 30px;
    display: inline;
    position: relative;
    top:-32px;
}  
nav ul li a {
    text-decoration: none;
    color: #ffffff;
}
nav ul li a:visited 
    {color: #ffffff;
}
nav ul li a:hover
    {color: #cccccc;
}
nav ul li a:active 
    {color: #ffffff;
}

I am very new to php and wordpress theming and I can’t find anyone online with the same issue.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T21:08:26+00:00Added an answer on June 12, 2026 at 9:08 pm

    The issue is that your theme_location does not match the name you assigned when you registered the menu.

    When you registered the menu, you called it main_nav. Since you called it that, in order to display that menu, you need to change the call to the menu to reference main_nav, like so:

    wp_nav_menu( array('theme_location' => 'main_nav' ) );

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on my own custom WordPress theme, using a blank, default template to
I am using a wordpress plugin that requires the following code in my template:
I'm using wordpress.org making a custom theme and I'm a complete PHP noob. It
I am using jquerymobile ,this code shows list with the colors of data-theme (black),
Is it possible to remove empty/blank lines using code formatting in Intellij IDEA?
I am using Visual Studio Express 2012 RC. If a create a blank hello
I'm editing the functions.php file of a WordPress theme and whenever I edit it,
I'm trying to start a new struts 2 project using maven (struts2 blank archetype)
Using Crystal Report 8.5 How to skip blank pages? I want to skip blank
I want to remove a blank page from a PDF generated using the iText

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.