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

Use this grid for documentation indexes, support routes, account links, affiliate resources, and download pages.

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.

Pricing update

Monthly & Lifetime plans are currently not unavailable

We’re not offering these payment options right now. Leave your name and email and we’ll let you know as soon as they return.

NameEmailNotify Me

No spam - Unsubscribe anytime