Tagged: portfolio grid
Hello, first I´d like to thank kriesi and his team for this amazing theme & support!
Unfortunately I didn´t find a solution in the forum, just one which is probably outdated. At the moment only the portfolio preview image is linked to the custom link.
I´d like the whole box to link to the custom link (in a new tab) if provided, otherwise it should link to the content page of the portfolio item.
Is there a solution/php code for this?
Hey p3nmarketing,
Thank you for your patience, try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:
function add_portfolio_custom_link_around_heading_content_open_new_tab() { ?>
<script>
(function($){
$('#av-sc-portfolio-1 .grid-sort-container .grid-entry').each(function(){
$link = $(this).find('a').clone().text('');
$(this).find('.grid-content').wrap($link);
$(this).find('a').attr('target', '_blank')
});
})(jQuery);
</script>
<?php
}
add_action('wp_footer', 'add_portfolio_custom_link_around_heading_content_open_new_tab', 99);
Please ensure to copy the code from the forum and not an email notification so the symbols are not converted.
Best regards,
Mike
Hello Mike,
the code works like a charm, thank you very much for the quick help! :)
Hi,
Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.
Best regards,
Mike