-
AuthorPosts
-
January 23, 2017 at 10:44 pm #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!
January 26, 2017 at 2:59 pm #738966Hey!
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,
YigitJanuary 26, 2017 at 8:57 pm #739120That 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.
January 26, 2017 at 11:16 pm #739152Hi!
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,
BasilisJanuary 30, 2017 at 5:36 pm #740316so 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.
January 30, 2017 at 5:42 pm #740321Hi!
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 -
AuthorPosts
- You must be logged in to reply to this topic.
