WordPress

Make Content Clickable In WordPress

Wordpress has a great feature I've just discovered which allows you to convert plain text into links for URLs or email addresses.

If your content has URLs in the content but you haven't add the link you can use this WordPress function to convert all plain text URLs to be links.

The WordPress function you need to use is called make_clickable().

This accepts one parameter which should be a string of the text you want to convert.

It will be able to convert a number of different types of links:

  • URLs - Adds link to the URL
  • www - Adds link to the www link
  • FTP - Adds link to the ftp link
  • Email - Adds a link with a mailto around the email address

<?php 
$string = "This is a long text that contains some links like http://www.wordpress.org and http://www.wordpress.com .";
echo make_clickable($string); 
?>
Back to top ^

Join Paulund

  • Get access to 100s of premium tutorials and downloadable content
  • Members content consists of Premium WordPress plugins, CSS packages, jQuery packages, tutorial demo files and templates for 100s of web development tutorials
  • In-depth development tutorials
  • Priority tutorial requests
  • Priority email development support
  • No ads

Here at Paulund you'll find Web Development tutorials and snippets focusing mainly on PHP, WordPress and CSS. Members will get access to premium tutorials that go into more detail about development with these languages. You will also get access to downloadable premium content based on the tutorial.

Join Paulund

Leave a Reply

Your email address will not be published. Required fields are marked *