X

Convierta URI, WWW, FTP y correos electrónicos en enlaces clicables

Snippets by IsItWP

¿Estás buscando una forma de convertir direcciones URI, WWW, FTP y de correo electrónico en enlaces clicables? Aunque probablemente exista un plugin para ello, hemos creado un rápido fragmento de código que puedes utilizar para convertir direcciones URI, WWW, FTP y de correo electrónico en enlaces clicables dentro de the_content y the_excerpt.

Instrucciones:

Todo lo que tienes que hacer es añadir este código al archivo functions.php de tu tema o en un plugin específico del sitio:

add_filter('the_content', 'make_clickable');
add_filter('the_excerpt', 'make_clickable');

Nota: Si es la primera vez que añades fragmentos de código en WordPress, consulta nuestra guía sobre cómo añadir correctamente fragmentos de código en WordPress, para no romper accidentalmente tu sitio.

Si te ha gustado este fragmento de código, por favor, considere revisar nuestros otros artículos en el sitio como: 7 mejores plugins de encuestas de WordPress para aumentar el compromiso en el sitio y cómo agregar una cartera a su sitio de WordPress.

Comentarios   Deja una respuesta

  1. All these old comments made me not want to give this a try -I thought maybe it may be outdated but its working nicely now in 2019.

    Thank you!

  2. I need an external link to “Read more” (example) at the end of an excerpt that links to the external site where the article was posted. I used WP “Press This” to create the post but it links to the post under my site’s permalink. I have tried everything. Creating the post in “Press This” does include a via (and then article name linked to article URL) but it doesn’t show up anywhere else when posted on my home page as a post.

  3. P. Neamt Cultural agosto 5, 2011 en 11:28 am

    This doesn’t seem to work on my template. What could be wrong? I’ve only used the_excerpt snippet, do I have to use them both?
    Thanks!

    1. Try placing make_clickable(get_the_content) or the_excerpt within your template and see if that will work for you.

  4. Hey, this is a cracking bit of code, how could I add this to a custom metabox.

    1. Hey glad you like the snippet, what you could do is wrap the make_clickable() around your content in your template. Rather then above you could do make_clickable(get_the_content());  so you could do something like that.

  5. Deux fonctions de traitement de texte WordPress bien pratiques | Yann "Bug" Dubois junio 16, 2011 en 6:53 am

    […] Appliquer la fonction “make_clickable” à tous les contenus pour rendre URL et adresses … addthis_url = 'http%3A%2F%2Fwww.yann.com%2Ffr%2Fdeux-fonctions-de-traitement-de-texte-wordpress-bien-pratiques-16%2F06%2F2011.html'; addthis_title = 'Deux+fonctions+de+traitement+de+texte+WordPress+bien+pratiques'; addthis_pub = ''; […]

Añadir un comentario

Nos alegra que haya decidido dejar un comentario. Tenga en cuenta que todos los comentarios se moderan de acuerdo con nuestra política de privacidad , y que todos los enlaces son nofollow. NO utilice palabras clave en el campo del nombre. Tengamos una conversación personal y significativa.

WordPress Launch Checklist

La lista definitiva para lanzar WordPress

Hemos recopilado todos los elementos esenciales de la lista de comprobación para el lanzamiento de su próximo sitio web de WordPress en un práctico ebook.
Sí, envíeme el ¡gratuito!