Envira Gallery Documentation

Documentation, Reference Materials and Tutorials for Envira Gallery

Enable Shortcodes in Gallery Descriptions

Would you like to enable shortcodes inside the gallery descriptions of your galleries? Envira Gallery makes that easy to do after a little customization. Let’s take a look at how to do this!

This tutorial is a bit more technical than our other docs, but we’ll walk you through the process step by step. In order to enable the distraction free mode, we’ll need to create and upload a basic WordPress plugin.

To enable shortcode in Envira gallery descriptions, just add the following code to a new file at /wp-content/plugins/envira-gallery-allow-shortcodes.php:

<?php
/*
* Plugin Name: Envira Gallery - Allow Shortcodes in Envira Gallery Description
* Plugin URI: https://enviragallery.com
* Version: 1.0.0
* Author: Envira Gallery Team
* Author URI: https://enviragallery.com
* Description: Add shortcodes to your Envira gallery descriptions
*/

add_filter( 'envira_gallery_output', 'do_shortcode' );

If you’re unsure how to create a plugin file, follow these steps below:

  1. Open a text file and make sure that it is a plain text document. You can use a plain text editor like Notepad or a code editor of your choice.
  2. Next, copy and paste the code shown below into the file and save the file as envira-gallery-allow-shortcodes.php
  3. Once you’ve saved the file you can easily upload this directly to your /plugins directory on your server using FTP or you can right-click on the text document and zip (or compress).
  4. Finally, log in to your WordPress dashboard and go to Plugins » Add New » Upload Plugin and upload the .zip file you just created in the previous step.

In your next step, you’ll just need to activate the plugin.

Navigate to the Plugins from within your WordPress dashboard and activate the Envira Gallery – Allow Shortcodes in Envira Gallery Description plugin.

Activate the plugin to allow shortcodes in your gallery description

For more customization to Envira Gallery, check out how to style image title and caption hover effects.


A: Currently this only works for Envira galleries.