Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #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 8 years, 7 months ago by MattDalli.
    #618350

    Hi 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,
    Yigit

    #618431

    Ah 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

    #618442

    Hey!

    Please add following code to Quick CSS as well

    #footer .image-overlay { display: none !important; }

    Regards,
    Yigit

    #618454

    Thanks a million Yigit! Spot on! :)

    #618466

    Hi!

    You are welcome Matt, glad we could help :)

    Cheers!
    Yigit

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Open Image & Social Media in New Tab’ is closed to new replies.