Miscellaneous WordPress

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…’));