How To Add Outbound Link In Wordpress Nav Bar
I this video you’ll learn two different ways to add a link from your wordpress navigation bar to any other page or website on the net.
This is useful to link to other sites you may have in a network of site you own or even to sales pages and affiliate products you want to sell. Use it sparingly to highlight your most important content that’s not directly on your wordpress site.
Your readers or site visitors and more likely to click on what appears to be another page on your site than a link to anywhere and this will help.
Code To Copy For Redirect.PHP file:
<?php
/*
Template Name: Redirect
*/if (have_posts()) {
the_post();
$pattern = ‘@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@’;
preg_match($pattern, get_the_excerpt(), $matches);
if ($matches[0]) header(‘Location: ‘.$matches[0]);
else echo ‘Enter a URL into your page body text.’;
}
?>
If you found this video helpful or you know someone who may, go ahead and share it using the options below… Your friends will thank you ;0).
Talk soon,

Malika Duke






