If you want to have a Wordpress Page link to an arbitrary url try this. It tells you how to create a Page template called redirect.php with the following
<?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.';
}
?>
No Comments so far ↓
There are no comments yet...Kick things off by filling out the form below.
You must log in to post a comment.