Often on larger news websites you’ll see articles linked to other news agencies, so that instead of having to write small posts that simply redirect users to another site, it links the article title to the external website. In WordPress this is fairly straight forward. Let’s take a look.
First, you’ll need to find how you’re currently linking the site titles. Most commonly, this is accomplished in your theme files multiple times, although in some rare cases the theme developer created a single common routine for all your title linking. Let’s start by opening your index.php theme file and looking for a line similar to this one:
Once you’ve found that, we’re going to want to change it to include an if statement based on a custom field.
if (strlen($external)==0) {
echo “Read More ‚Ķ”;
} else {
echo “Read More ‚Ķ”;
}
Now, what this code does is pretty straight forward in that it checks for a custom field associated with the post and, if it’s found, the Read More text is linked to an external URL in a new blank browser instead of the internal link.
Depending on how your coder developed your theme, you will most likely need to search through multiple files to replace all references to the post. Most commonly, these will be found in the index.php, category.php, archive.php, search.php and single.php files.
To make the redirect work, simply add a custom field in your post with the title externalurl and a URL for the value. WordPress will take care of the rest.

Pingback: Tutorials :: Redirecting a WordPress Post With Custom Fields » Christopher Ross