Envira Gallery Documentation
Documentation, Reference Materials and Tutorials for Envira Gallery
Documentation, Reference Materials and Tutorials for Envira Gallery
Would you like to disable keyboard and mousewheel navigation for your galleries or albums? Envira can help you do just that! This guide will show you how.
To disable keyboard and mousewheel navigation, just add the following code to a new file at wp-content/plugins/envira-keyboard-mousewheel-navigation.php
.
<?php /* * Plugin Name: Envira Gallery - Disable Keyboard and Mousewheel Navigation * Plugin URI: https://enviragallery.com * Description: Plugin that disables keyboard and mousewheel navigation for Albums and Galleries * Author: Envira Gallery Team * Author URI: https://enviragallery.com * Version: 1.0 */ // Disable for Albums add_filter( 'envira_albums_pre_data', 'my_envira_album_pre_data', 10, 2 ); function my_envira_album_pre_data( $data, $album_id ) { $data['config']['keyboard'] = 0; // 0 for disable, 1 to enable $data['config']['mousewheel'] = 0; // 0 for disable, 1 to enable return $data; } // Disable for Galleries add_filter( 'envira_gallery_pre_data', 'my_envira_gallery_pre_data', 10, 2 ); function my_envira_gallery_pre_data( $data, $gallery_id ) { $data['config']['keyboard'] = 0; // 0 for disable, 1 to enable $data['config']['mousewheel'] = 0; // 0 for disable, 1 to enable return $data; }
If you’re unsure how to create a plugin file, follow these steps below:
envira-keyboard-mousewheel-navigation.php
.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 Keyboard and Mousewheel Navigation plugin.
That’s it! Would you like to extend Envira further? Check out our tutorial on how to Display Adsense Ads in Lightbox.