How to Link to External Links from the Post Title in WordPress


How to Link to External Resources from a Post Title in WordPress
Tiffany Ballard

Linking to external sources can be used in a variety of ways. From sharing content with blog subscribers to sharing news and topical data to your business visitors, it’s just another way you can accentuate WordPress web hosting to suit your needs. Sometimes a quick link to something important is all you really need to keep the audience engaged.

WordPress.org
Antonetta Mull

Catalan, Croatian, Czech, Danish, Dutch, English (Australia), English (Canada), English (New Zealand), English (UK), English (US), Esperanto, French (Canada), French (France), Galician, German, Hebrew, Hungarian, Italian, Japanese, Norwegian (Bokmål), Persian, Portuguese (Brazil), Portuguese (Portugal), Russian, Spanish (Spain), Swedish, and Ukrainian.

Make a WordPress Title Link to an External URL
Brandy Gill

If you don’t know how to add custom code to WordPress like this, take a look at my earlier tutorial on the same. The code above hooks into the “post_link” filter which is used as a “behind the scenes” tool to generate the URL of posts and pages. What we’re doing here is simple – we check to see whether or not our entry has a custom variable and if so, uses that instead of the original. In the absence of such a custom variable, we only have to return the initial URL that was passed. Save your functions.php file and open up your blog to view your page or post when it’s part of an archive. The homepage will do just fine.

Be the first to comment

Leave a Reply

Your email address will not be published.


*