Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #737445

    I am working on ADA Compliance and I need to find a way to add a title tag that says, “this will open in a new window” to the social media links. Or any link that has target=”_blank for that matter but I don’t know how to get it for the social media links specifically. thanks!

    #738966

    Hey!

    Please add following code to Functions.php file in Appearance > Editor

    function av_social_target(){
    ?>
     <script>
    jQuery(window).load(function(){
    jQuery('.social_bookmarks li a').attr('target','_blank');
    });
     </script>
    <?php
    }
    add_action('wp_footer', 'av_social_target');

    Best regards,
    Yigit

    #739120

    That is opening in new window but does not add the title tag, I need to add the title tag that says “this will open in a new window” for ADA compliance, that is so people that are disabled are notified they are leaving when they tab over to it.

    #739152

    Hi!

    Add also the following to the code that Yigit provided and let us know if it works

    $(‘.social_bookmarks li a’).prop(‘title’, ‘this will open in a new window’);

    let us know if we can do anything else

    Regards,
    Basilis

    #740316

    so what is the code supposed to be in full? When I try to add $(‘.social_bookmarks li a’).prop(‘title’, ‘this will open in a new window’); to what Yigit sent, it gives me an error.

    #740321

    Hi!

    Please try changing the code to following one

    function av_social_target(){
    ?>
     <script>
    jQuery(window).load(function(){
    jQuery('.social_bookmarks li a').attr('target','_blank');
    jQuery('.social_bookmarks li a').attr('title','This will open in a new window');
    });
     </script>
    <?php
    }
    add_action('wp_footer', 'av_social_target');

    If that too does not help, please post a screenshot and show the changes you would like to make. An example site would work too

    Best regards,
    Yigit

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.