Modula offers various customization options to enhance the functionality and performance of your galleries.
Previously, these settings were accessible under the Miscellaneous (Misc) tab in the Modula settings.
However, starting from the latest update, these options are no longer available as toggles in the Modula Lite settings. Instead, they can now be enabled or disabled using filters in your theme’s functions.php
file.
How to Use Filters to Adjust Miscellaneous Settings
To configure these settings, you need to add specific filters to your functions.php
file. Below is an overview of each setting and how to enable or disable it using filters.
Enqueue Modula Assets
Filter: modula_troubleshooting_enqueue_files
Default: FALSE
Usage: If you’re experiencing issues with gallery display or functionality, enabling this filter ensures that Modula’s CSS and JS files are loaded on all pages.
Example: add_filter( 'modula_troubleshooting_enqueue_files', '__return_true' );
Grid Types
Filter: modula_troubleshooting_gridtypes
Default: custom-grid | justified-grid | isotope-grid
Usage: This filter allows you to define which grid types should be enqueued.
Example: add_filter( 'modula_troubleshooting_gridtypes', 'modula_ts_gridtypes' );
function modula_ts_gridtypes( $handles ){
return array(); // Turns all off.
}
Lightbox & Links
Filter: modula_troubleshooting_lightboxes
Default: fancybox
Usage: If you need to enable Fancybox lightbox scripts and styles globally, use this filter.
Example: add_filter( 'modula_troubleshooting_lightboxes', 'modula_ts_lightboxes' );
function modula_ts_lightboxes( $handles ){
$handles[] = 'fancybox';
return $handles;
}
Lazy Load
Filter: modula_troubleshooting_lazy_load
Default: FALSE
Usage: If you want to enable lazy loading for your galleries, use this filter.
Example: add_filter( 'modula_troubleshooting_lazy_load', '__return_true' );
Disable “Edit Gallery” Link
Filter: modula_troubleshooting_disable_edit
Default: FALSE
Usage: If you want to remove the “Edit Gallery” link from the front end, enable this filter.
Example: add_filter( 'modula_troubleshooting_disable_edit', '__return_true' );
Disable Images Srcset
Filter: modula_troubleshooting_disable_srcset
Default: FALSE
Usage: If you experience issues with responsive image loading or need greater control over image sizes, disable the srcset attribute using this filter.
Example: add_filter( 'modula_troubleshooting_disable_srcset', '__return_true' );
Additional Filters for Modula PRO
If you are using Modula PRO, additional filters are available for hover effects, link shortcodes, and slider scripts.
Hover Effects
Filter: modula_troubleshooting_hover_effects
Default: FALSE
Usage: Enable this filter to troubleshoot hover effects.
Example: add_filter( 'modula_troubleshooting_hover_effects', '__return_true' );
Link Shortcode
Filter: modula_troubleshooting_link_shortcode
Default: FALSE
Usage: Enable this filter if you need support for link shortcodes.
Example: add_filter( 'modula_troubleshooting_link_shortcode', '__return_true' );
Slider Scripts & Styles
Filter: modula_troubleshooting_slider_scripts
Default: FALSE
Usage: If you are using slider-type galleries, enable this setting to load the necessary scripts and styles.
Example: add_filter( 'modula_troubleshooting_slider_scripts', '__return_true' );
The Miscellaneous settings in Modula are now managed through filters instead of toggles in the settings panel.
By adding the appropriate filters to your functions.php
file, you can enable or disable specific features according to your gallery needs.
This provides greater flexibility and ensures optimal performance and compatibility across your website.