Envira Gallery Documentation

Documentation, Reference Materials and Tutorials for Envira Gallery

How to Enable the Envira Distraction Free Mode

Would you like to turn on the Distraction Free viewing when viewing lightbox images on Envira? Distraction Free viewing is where the after 30 seconds, the icons disappear giving full impact of your image in the lightbox. This tutorial will walk you through how to disable that feature in Envira.

This tutorial is a bit more technical than our other docs, but we’ll walk you through the process step by step. In order to enable the distraction free mode, we’ll need to create and upload a basic WordPress plugin.

Creating the Plugin

To enable the distraction free mode, just add the following code to a new file at /wp-content/plugins/envira-disable-distraction-free.php:

<?php
/**
* Plugin Name: Envira Gallery - Disable Distraction Free Mode
* Plugin URI: https://enviragallery.com
* Version: 1.0.0
* Author: Envira Gallery Team
* Author URI: https://enviragallery.com
* Description: Disables Distraction Free Mode on Envira Lightbox
*/
add_filter( 'envira_gallery_get_config', 'my_envira_gallery_get_config', 10, 2 );
function my_envira_gallery_get_config( $data_config, $key ) {
	if ( $key === 'idle_time' ) {
		$data_config['idle_time'] = 60; // false would completely turn off the option and is set to false by default.  Change this to 60 to have the idle time kick in after 60 seconds
	}
	return $data_config;
}

If you’re unsure how to create a plugin file, follow these steps below:

  1. Open a text file and make sure that it is a plain text document. You can use a plain text editor like Notepad or a code editor of your choice.
  2. Next, copy and paste the code shown below into the file and save the file as envira-disable-distraction-free.php
  3. Once you’ve saved the file you can easily upload this directly to your /plugins directory on your server using FTP or you can right-click on the text document and zip (or compress).
  4. Finally, log in to your WordPress dashboard and go to Plugins » Add New » Upload Plugin and upload the .zip file you just created in the previous step.

Activate the Plugin

Your next step is to activate the plugin you just uploaded. Simply navigate to the Plugins from within your WordPress dashboard and activate the Envira Gallery – Disable Distraction Free Mode plugin.

Envira Gallery - disable the distraction free mode on lightbox

And that’s it! You’ve now disabled the distraction free mode on the Envira Gallery lightbox.

Would you like to try some more fun things with Envira lightbox? Why not check out our article on How to Use the Lightbox Transition Effects.


FAQ

A: Currently no, this will only apply to galleries for now. We’ll update the doc when this is available for albums so keep checking back!


A: No, this will apply to all galleries (and albums when albums becomes available).


[i]
[i]