Envira Gallery Documentation
Documentation, Reference Materials and Tutorials for Envira Gallery
Documentation, Reference Materials and Tutorials for Envira Gallery
Would you like to show a unordered or ordered list in your Envira caption? This is simple with the use of a custom function inside a plugin. This tutorial will walk you through the steps of what you need to add lists to your Envira caption.
To use HTML for ordered and unordered lists in your Envira caption, just add the following code to a new file at wp-content/plugins/envira-text-format-for-captions.php
.
<?php /** * Plugin Name: Envira Gallery - Text format for captions * Plugin URI: https://enviragallery.com * Version: 1.0.0 * Author: Envira Gallery Team * Author URI: https://enviragallery.com * Description: Allow certain HTML characters in the caption area under gallery images */ add_filter( 'envira_gallery_image_caption_allowed_html_tags', 'example_envira_gallery_image_caption_allowed_html_tags', 5, 5 ); function example_envira_gallery_image_caption_allowed_html_tags( $allowed_tags, $id, $item, $data, $i ) { /* allowed tags is an array */ $allowed_tags['li'] = array(); $allowed_tags['ul'] = array(); $allowed_tags['ol'] = array(); return $allowed_tags; }
If you’re unsure how to create a plugin file, follow these steps below:
envira-text-format-for-captions.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 – Text format for captions plugin.
And that’s it, you’re all done! Would you like to try adding some CSS for you Envira lightbox? Check out our tutorial on How to Remove the Lightbox Border.