This cool little theme code snippet allows the wordpress navigation to link to a page outside of wordpress. It takes advantage of custom fields for pages.
Just place this code at the top of your themes header.php file
<?php
/*
Copyright (c) 2009 < Nate Nuzum >
Use under terms of MIT license
*/
global $post;
$redirect = get_post_meta($post->ID, 'redirect', true);
if ($redirect)
wp_redirect($redirect);
?>
Then create a page with the name having the link text you want to appear in the navigation add a custom field to the page called redirect and place the link url into the value field.
#1 by Ed on March 5, 2010 - 9:39 pm
Quote
Thanks for the code…works like a charm on the new site I’m working on….cheers!
[Translate]
[Reply]
#2 by Lee on June 19, 2010 - 7:12 am
Quote
Thanks alot for this, I’ve been looking for days on how to do this! Thanks again,
Lee
[Translate]
[Reply]