Force Thumbnail Links To Load In New Tab

If you are using custom URL’s for your gallery thumbs, then you might also want to make those links open in a new tab.

To add this functionality, simply add the following code snippet to your functions.php file:

function foogallery_links_new_tab($attr, $args, $foogallery_attachment) {
    $attr['target'] = '_blank';
    return $attr; 
}

add_filter( 'foogallery_attachment_html_link_attributes', 'foogallery_links_new_tab', 10, 3 );

Please note that you will need to set your gallery “Link To” setting to use custom URL’s: 

Link to Custom URL

Also please note that this will be applied to ALL galleries. If you want to limit this to a specific gallery, then you could check the ID of the global $current_foogallery;

Resources

Find the right next step

Browse setup guides, get help with your site, or find licensing information.

Documentation

Search setup guides, product docs, and troubleshooting articles.

Support

Open a ticket with product details so we can help quickly.

Licensing

Review account, renewal, refund, and license information.