Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I followed this tutorial to add a menu item to navigation menu to link to external site:

http://www.natenewz.com/2009/10/07/hardlink-wordpress-navigation/

I copied the snippet of code to my theme's header.php I created a page with the name having the text that I want to appear in the navigation I added a custom field to the page called redirect and placed the link url into the value field.

And then tested and the link never appears in the menu.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Are you trying to navigate to an external page or redirect? (Also, bear in mind that was posted almost 3 years ago...in websites and technology in general, that's an eternity!)

You could always just add a custom link to the WordPress menu under Appearance->Menus. Just make sure you add support in the functions.php file.

http://codex.wordpress.org/Appearance_Menus_Screen

And here for adding theme support: http://codex.wordpress.org/Navigation_Menus

This is how you would add functional support:

//setup the dynamic navigation
if (function_exists(register_nav_menus)){
    register_nav_menus(
                 array(
                "main_nav" => "Main Navigation Menu"
                      )
                );
 }

Then go to the admin panel->Appearance->Menus, and add your external link there.

Then in your template, you would call it like so:

<?php wp_nav_menu(array('menu' => 'Main Nav Menu')); ?>

This is, ofcourse, what you were looking for

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.