Learn how to use a short code snippet to autolink Twitter mentions on WordPress posts to their respective pages. This article shows you how to add a short PHP code snippet to functions.php to autolink Twitter user names.
Follow the steps below to edit your Theme setting file:
On the Theme Editor , select the Theme you want to edit from the dropdown:
Copy and paste the following code block into functions.php.
function add_twitter_links($content) { return preg_replace('/([^a-zA-Z0-9-_&])@([0-9a-zA-Z_]+)/', "$1@$2", $content); } add_filter('the_content', 'add_twitter_links'); add_filter('comment_text', 'add_twitter_links');
For more information about the please visit the following link:https://wordpress.org/plugins/theme-editor/
Subscribe to receive weekly cutting edge tips, strategies, and news you need to grow your web business.
No charge. Unsubscribe anytime.
Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.
Usamos cookies para personalizar o site para você e para analisar o uso do nosso site. Você demonstra que concorda com isso ao clicar em "Eu concordo" ou ao continuar usando este site. Mais informações sobre cookies podem ser encontradas em nossa Política de privacidade.