Tagged: image, open in new tab, social media
-
AuthorPosts
-
April 20, 2016 at 1:10 pm #618270
Hi guys,
I have two images of companies in the footer which are in a widget and they have to be linked to their respective websites. I put the following code in the widget since there isn’t a way to place an image in the footer automatically (at least to my knowledge).
<a href="http://www.maltacvs.org/" target= "_blank"><img src="http://newsite.specialolympicsmalta.org/wp-content/uploads/2016/04/MVC-for-Web-01.png" width="500" height ="200" /img></a>As you can see, in theory, the image should open in a new tab but it doesn’t.
I also have this issue with the social media buttons, which are located in the header, and I require them to open up in a new tab once clicked on.
http://newsite.specialolympicsmalta.org/
Any help appreciated.
-
This topic was modified 9 years, 6 months ago by
MattDalli.
April 20, 2016 at 2:57 pm #618350Hi Matthew!
Please add following code to functions.php file in Appearance > Editor
function custom_link_target(){ ?> <script> jQuery(window).load(function(){ jQuery('#top .social_bookmarks li a,#footer #text-3 a, #footer #text-4 a').attr('target','_blank'); }); </script> <?php } add_action('wp_footer', 'custom_link_target');Regards,
YigitApril 20, 2016 at 4:07 pm #618431Ah Yigit,
Always to the rescue. Why there isn’t the title of ‘Savour of all low and hold of Enfold’ is beyond me :D
The code worked and everything is perfect. Just one thing that I would like to arrange is that when you hover over the images of the footer they get a hover effect. Can you please pass the code to remove this please?
Thanks again!
Matt
April 20, 2016 at 4:17 pm #618442Hey!
Please add following code to Quick CSS as well
#footer .image-overlay { display: none !important; }Regards,
YigitApril 20, 2016 at 4:24 pm #618454Thanks a million Yigit! Spot on! :)
April 20, 2016 at 4:36 pm #618466 -
This topic was modified 9 years, 6 months ago by
-
AuthorPosts
- The topic ‘Open Image & Social Media in New Tab’ is closed to new replies.
