Changing the social link’s titles displayed on mouse hover

⚠️ Code snippets might not be compatible with the latest version of your theme. Always use a child theme to customize your theme, and test your code on a staging website before migrating to production.

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”

Comments are closed.