Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1368140

    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

    #1368193

    Hi Lyse,

    Can you share with us the code snippet that you used?

    Best regards,
    Nikko

    #1368203

    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

    #1368214

    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

    #1368351

    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

    #1368362

    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

    #1368366

    Hi Nikko
    So perfect!
    Thank you so much.
    Lyse

    #1368372

    Hi Lyse,

    We’re glad that we could help you :)
    Thanks for using Enfold and have a great day!

    Best regards,
    Nikko

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Change social share title on blog post without ALB’ is closed to new replies.