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
Or is there an easier way to have 4 pictures with links in 2 rows in a widget in the footer?
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
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
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
Hi Ismael,
that works!
Phantastic support!
Thank you very much
Bernd