Envira Gallery Documentation
Documentation, Reference Materials and Tutorials for Envira Gallery
Documentation, Reference Materials and Tutorials for Envira Gallery
Would you like to remove the fragment cache from Envira? Fragment caching is something Envira does to cache the images on your page to increase loading for larger galleries. This tutorial will walk you through how to remove that cache with the use of a plugin we will create.
To remove fragment cache, just add the following code to a new file at wp-content/plugins/envira-remove-fragment-cache.php
.
<?php <?php /* * Plugin Name: Envira Gallery - Remove Fragment Cache * Plugin URI: https://enviragallery.com * Description: Plugin that removes fragment cache * Author: Envira Gallery Team * Author URI: https://enviragallery.com * Version: 1.1 */ add_filter( 'envira_gallery_get_transient_markup', '__return_false' ); add_filter( 'envira_gallery_should_cache', '__return_false' );
If you’re unsure how to create a plugin file, follow these steps below:
envira-remove-fragment-cache.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 – Remove Fragment Cache plugin.
That’s it! Would you like to extend Envira further? Check out our tutorial on how to Display Adsense Ads in Lightbox.