Convert URLs to Links on WordPress Content

So you have been in a situation where you want all the urls on the content of your post to be a link. Well if you have found yourself in such situation, you can always make use of make_clickable function that is available by default on WordPress. What this basically does is convert all http, https, ftp , ftps, emails to clickable link, hence no further coding and head banging. ;)

The file that has the function is located on “wp-includes/formatting.php”. You can use this on the main loop as show below or you could simply use it anywhere else referencing the function by including the file from wp-includes folder.

echo make_clickable(get_the_content(‘Read the full story…’));

 

Utsav Singh Rathour is a WordPress Enthusiast and a blogger with over 10 years of experience and believes in building applications that not only tackles the problem but gives users a better interface. He is founder of Code Pixelz Media and blogs mainly at this place. Follow him at @rathour

Share

1 Response

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.