0

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.

1 Answer 1

2

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

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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