Envira Gallery Documentation
Documentation, Reference Materials and Tutorials for Envira Gallery
Documentation, Reference Materials and Tutorials for Envira Gallery
Envira uses a default template in your WordPress theme for standalone galleries. While you can change this via the backend settings on a gallery by gallery basis – if you’d like to do this on a code level we can help walk you through how to do that!
We’ll begin by creating a custom plugin. Just add the following code to a new file at wp-content/plugins/envira-change-standlone.php
.
<?php /** * Plugin Name: Envira Gallery - Change Standalone Template * Plugin URI: https://enviragallery.com * Version: 1.0 * Author: Envira Gallery Team * Author URI: https://enviragallery.com * Description: Changes the Standalone template. */ add_filter( 'envira_standalone_get_custom_template', 'test_envira_standalone_get_custom_template', 10, 3 ); function test_envira_standalone_get_custom_template( $new_template, $data, $post ) { $new_template = 'envira-standalone.php'; return $new_template; }
If you’re unsure how to create a plugin file, follow these steps below:
envira-change-standalone.php
.Your final step is to activate the plugin you just uploaded. Simply navigate to the Plugins from within your WordPress dashboard and activate the Envira Gallery – Change Standalone Template plugin.
And that’s it!