Hi, on my websites – created with the Enfold theme – I want the portfolios to open in a new tab. Would you be so kind as to advise me on how this could be done? Many thanks!
Hey icphillips,
Sorry for the late reply. Please try this in your functions.php file:
function ava_add_target_blank_masonry() {
?>
<script>
jQuery(document).ready(function($) {
$('a.av-masonry-entry').attr('target', '_blank');
});
</script>
<?php
}
add_action( 'wp_footer', 'ava_add_target_blank_masonry');
Best regards,
Rikard
Hi icphillips,
Yes, you’ll just need to copy and paste the code at the bottom of functions.php.
However, we don’t recommend it in the parent theme (enfold) since it will be overwritten during an update, we suggest putting it in a child theme’s functions.php file.
If you already have a child theme, just ignore this, otherwise, you can download and find further instructions here: https://kriesi.at/documentation/enfold/child-theme/
Best regards,
Nikko