Tagged: Social Media Links
Hi
I added this code snippet to my website blog: https://diyjewellery.com/planning-for-christmas-craft-shows/
However nothing changes.
I would also like the text changed for the added IG and YouTube links so all say the same.
I appreciate any assistance you can provide.
Lyse
Hi Lyse,
Can you share with us the code snippet that you used?
Best regards,
Nikko
Hi Nikko
Here’s the code snippet
* Use the
“avia social share title”
filter to change title of Social
Share Buttons element
*
**/
3
4
5
6
7
8 add filter(‘avia social share title’
‘new share title’);
9
function new share title() –
10 Soutput
=
‘Share tyhis post on: ‘i
11 return Soutput;
12
}
)
I copied from the Emfold documentation
Thanks
Lyse
Hi Lyse,
It seems correct based on the code given.
I could see Share tyhis post on:
I tested the hook/filter:
add_filter('avia_social_share_title','new_share_title');
function new_share_title() {
$output = 'Share this post on:';
return $output;
}
And it does change the title.
Best regards,
Nikko
Hi Nikko,
I see it now, but how to I get the IG and YouTube tooltip to use the same text as for FB, Twitter, Pinterest – “Share on Intagram” and “Share on YouTube”?
Thanks
Lyse
Hi Lyse,
Please try to add this PHP code in functions.php of your child theme:
add_action('wp_footer', 'change_tooltip_text');
function change_tooltip_text(){
?>
<script>
var socialTooltip = document.querySelectorAll("a[data-avia-related-tooltip]");
socialTooltip.forEach((item) => {
var tooltip = item.getAttribute("data-avia-related-tooltip");
tooltip = tooltip.replace("Link to", "Share on");
item.setAttribute("data-avia-related-tooltip", tooltip);
});
</script>
<?php
}
Hope this helps.
Best regards,
Nikko
Hi Nikko
So perfect!
Thank you so much.
Lyse
Hi Lyse,
We’re glad that we could help you :)
Thanks for using Enfold and have a great day!
Best regards,
Nikko