Here’s a quick snippet to change the title attribute of the social links that’s displayed when the mouse moves over the link’s icon.
By default, it can take two forms :
– for rss : Subscribe to my rss feed
– for the social networks : Follow me on [the social network]
Let’s say you want to switch to ‘our’ instead of ‘my’
add_filter('tc_default_socials' , 'change_link_title'); function change_link_title($socials) { foreach ($socials as $key => $value) { $socials[$key]['link_title'] = str_replace('Follow me', 'Follow us', $socials[$key]['link_title']); $socials[$key]['link_title'] = str_replace('Subscribe to my rss feed', 'Subscribe to our rss feed', $socials[$key]['link_title']); } return $socials; }
Where to paste this code? => in your functions.php file. I strongly recommend to create a child theme. Download a start-up child theme here.
Everything you need to know about child theme with Customizr here.
26 thoughts on “Changing the social link’s titles displayed on mouse hover”
At some point the verb used for Pinterest was changed to “pin” as in “pin me on Pinterest”.
To capture this one, just add the following line to the body of the original snippet.
All together, it will look like this:
Thanks for sharing this code 🙂
hello Nicolas. I have a new question for you. I hope you know help me.
I replaced the original link of my feed, with a different url that points to feedbunrer, since I use this to show my feed.
the problem is that now instead of opening the link in a new page like other social opens in the same page of my site.
how do i open the link in a new page in feedburner?
I hope you will help me thanks
Anna
????
Hey Nicolas,
Great theme, much appreciated. I use Customizr with the Polylang plugin for a bilingual page. I also use the snippet above, so I was wondering whether there is a way to display the mouse hover text in the language that the user chose with the language selector in the menu.
Thanks in advance!
Hi Philip, you might want to read this guide on how to use Polylang with the Customizr theme .
Hope this helps
Thanks for the reply Nicolas. I used the article you referred to to set up my Customizr with Polylang, including the bridge-snippet, and all in all it works beautifully.
I also read the other article “Changing the social link’s titles displayed on mouse hover ” in order to change the social links’ titles (from “Follow me” to “Follow us”), and it, too, works fine in itself.
But even after re-reading the article you referred to, I could not find any mentioning of mouse-over-texts. To rephrase, what I am trying to achieve is that the mouse-over texts for the social icons are displayed in the language that the site is displayed in. Any ideas?
Thanks in advance.
To rephrase yet again: mouse-over titles for the social icons change their language just fine, as long as the snippet from “Changing the social link’s titles displayed on mouse hover” is not involved.
I like this code.. nice and clear and actually very straightforward! Strangely enough I was able to change the Google + and LinkedIn text but the feed link text just won’t change:
Code I used:
Any thoughts maybe why I can’t get the feed link title to change?
Thanks!
Michael
I tried again and used the code above.. and it worked fine.. thanks!
I think I just solved that – Here’s the reason it was not working for the RSS feed:
SNIPPET TYPO:
“Suscribe” instead of “Subscribe”
I guess the code was calling to replace “suscribe”, but because there is no actual “suscribe” to call-onto, it did not replace what it could not locate in the first place. Once I changed all instances of “suscribe” to “subscribe” (With the ‘B’), within the code, the snippet worked like a charm!
Perhaps update the snippet to reflect the correct spelling? That would save people some reading and a bit of a headache! Thanks!
Thanks for this correction Mike!
Best whishes
I tried utilizing this snippet to change the “Follow my” and “follow me” – It seems to have worked for ALL social icons (EXCEPT) the RSS Feed, which still shows “Follow my” instead of “our”. I have deleted and re-added the snippet various times, and it always works perfectly for everything except the RSS feed. Any ideas?
Greetings! I was wondering if I can change the font in the header of my new Customizr site? I would like a prettier font for my tagline, and moving it to the left would be great too. Thanks!
Hi Jennifer, you can easily do that with simple css customizations in the Customizr theme.
If you are new to Customizr (and WordPress), you might want to read this short guide on how to customize Customizr.
Then check this guide on CSS essentials in Customizr.
Hope this helps!
Nicolas,
I’m trying to put the social links in a separate custom menu. Having a hard time figuring out the hooks and filters without the dev tools.
Would you be able to point me in the right direction to find a hook/filter to remove the social-block and place it some where else or to override tc_render_menu()?
Thanks
I think I answered my own questions. Found this snippet that will help with removing the socials icons on http://www.presscustomizr.com/snippet/center-header-block-items/
This also helps me understand the Customizr filters a little more 🙂
Thanks for this feedback Johnnie!
I will come with a “hook map” of the Customizr theme pretty soon to help users find the right filters and actions.
Best
Hi Nic,
I asked the question in the forum, you guys are amazing, love the theme!
Hi Michael, please share the link of your thread in the WP forum!
Thanks
here is a link to the question! https://wordpress.org/support/topic/edit-the-words-subscribe-to-my-feed?replies=4
For those like me, who need a bit more direction: I pasted this snippet at the very bottom of the functions.php file, after “new TC___;” and it worked like a charm.
p.s. Thanks to Nicolas for his continued attention to Customizr!
Hi John and thanks for this feedback!
I recommend to use a child theme for your customizations => this way you won’t loose them on update.
More about child theme here : http://www.presscustomizr.com/snippet/creating-child-theme-customizr/
This is great, but how can we change it and keep the translation function ?
Without these lines of codes, the “follow-me” is automaticly translated to the two other languages of my site, French and simplified Chinese (qTranslate) and your nice language bar. You can have a look here : kreega.com.
Best regards.
Thank you Nicolas, this worked like a charm!