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

    Hello,

    is it it possible to have a link not opening a new window but in the same window, when using a “Advertising Area” Widget in the Footer?

    Thanks for Help!
    Bernd

    #453642

    Or is there an easier way to have 4 pictures with links in 2 rows in a widget in the footer?

    #453893

    Hey!

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

    function add_custom_target(){
    ?>
    <script>
    jQuery(window).load(function(){
    jQuery('.avia_partner_widget a').removeAttr('target');​
    });
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_target');

    Regards,
    Yigit

    #453922

    Hi Yigit

    Code looks like this now in the functions.php of the child theme:

    <?php
    function add_custom_target(){
    ?>
    <script>
    jQuery(window).load(function(){
    jQuery(‘.avia_partner_widget a’).removeAttr(‘target’);​
    });
    </script>
    <?php
    }
    add_action(‘wp_footer’, ‘add_custom_target’);

    But it does not work, the link still opens in a new Browser window

    #454403

    Hey!

    Try to replace the code with this:

    add_action('wp_footer', 'ava_custom_script', 10);
    function ava_custom_script(){
    ?>
    <script>
    (function($){
      $('.avia_partner_widget a').each(function() {
        $(this).removeAttr('target');
      });
    }(jQuery));
    </script>
    <?php
    }

    Cheers!
    Ismael

    #454427

    Hi Ismael,
    that works!
    Phantastic support!
    Thank you very much
    Bernd

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Internal Link in "Advertising Area" Widget ?’ is closed to new replies.