Envira Gallery Documentation

Documentation, Reference Materials and Tutorials for Envira Gallery

Open Gallery Links in New Window

Your galleries don’t always have to link to a lightbox image. They can link to external sites. By default, the external site will open in the same window, but if you want them to open in a new window, drop the code below into your theme’s functions.php file:

add_filter( 'envira_gallery_output_link_attr', 'tgm_envira_link_new_window' );
function tgm_envira_link_new_window( $attrs ) {

    return $attrs . ' target="_blank"';