Skip to content

Snippet: Disable Touch Motions on Lightbox

By default the included lightbox script in the theme (Fancybox 3) includes touch motion support for swiping between photos. If you wish to disable touch support you can via the following code.

/**
 * Disable Touch Motions on Lightbox.
 *
 * @link https://total.wpexplorer.com/docs/snippets/disable-touch-motions-on-lightbox/
 */
add_filter( 'totaltheme/lightbox/l10n', function( $settings ) {
	$settings['touch'] = false;
	return $settings;
} );
All PHP snippets should be added via child theme's functions.php file or via a plugin. We recommend Code Snippets (100% Free) or WPCode (sponsored)
Back To Top