Tagged: new window, rss, target blank
Hi,
I have searched through the forum but cannot seem to find the answer. How do I get the RSS Icon in the header and footer to open in a new window?
Kind regards,
Mark
Hey Mark,
Could you post a link to where we can see the element in question please?
Best regards,
Rikard
Hi,
My website is: https://www.simplygreatoffers.com/
A few months back you gave me the following code to set the “Learn More” button in the cookies consent pop-up to open up in a new window (target blank). Is it possible to alter it for the RSS icons in the header and footer maybe?
/*set learn more button on cookies pop-up to target blank*/
add_action(‘wp_footer’, ‘ava_consent_button_target’, 9999);
function ava_consent_button_target() {
?>
<script>
(function($) {
$(‘.avia-cookie-consent-button’).attr(‘target’, ‘_blank’);
})(jQuery);
</script>
<?php
}
Kind regards,
Mark
Hi Mark,
I think that should be possible yes, please try this function in functions.php as well:
function markransome_rss_new_tab() {
?>
<script>
(function($) {
$('.av-social-link-rss a').attr('target', '_blank');
})(jQuery);
</script>
<?php
}
add_action('wp_footer', 'markransome_rss_new_tab', 9999);
Best regards,
Rikard
Hi,
Yes, thanks for that, it works a treat!
Cheers,
Mark