Envira Gallery Documentation

Documentation, Reference Materials and Tutorials for Envira Gallery

How to Enable Archives for Standalone Feature

Would you like to enable archives for standalone links in Envira Gallery? You can easily do this by creating a custom plugin. This documentation will help walk you through the steps needed to enable archives for standalone links in Envira Gallery.

This tutorial is a bit more technical than our other docs. In order to use enable archives for Envira, please review the steps below.

Archives is a list of all galleries you’ve created and each gallery would list as a link to the gallery standalone link.

To enable archives for the standalone feature in Envira, just add the following code to a new file at wp-content/plugins/envira-standalone-archive-support.php.

<?php
/**
* Plugin Name: Envira Gallery - Standalone Feature - Enable Archives
* Plugin URI: https://enviragallery.com
* Version: 1.0
* Author: Envira Gallery Team
* Author URI: https://enviragallery.com
* Description: Enables archives for Envira Custom Post Type
*/
 
/**
* Enable archives and featured image capabilities on Envira Galleries
*/
function envira_standalone_enable_archives( $post_args ) {
     
    $post_args['has_archive'] = true;
    $post_args['supports'] = array( 'title', 'thumbnail' );
    return $post_args;
 
}
add_filter('envira_gallery_post_type_args', 'envira_standalone_enable_archives');

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 that matches the page builder you’re using into the file and save the file as envira-standalone-archive-support.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.

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 – Standalone Feature – Enable Archives plugin.

Activate the custom plugin to enable archives for standalone gallery links

And that’s it! If you’ve set a featured image on your Envira gallery, then the title of the gallery and the featured image will show on your archive page.

If you’d like to extend Envira further, check out our tutorial on How to Load Your Gallery Lightbox from a Text Link.


A: The archive pages uses the slug of your galleries you’ve specified in the WordPress Admin » Envira Gallery » Settings » Standalone tab view.

Find the standalone slug name to access your archives

For example, if you’ve set your Standalone Gallery slug to “my_gallery” then you can view the archive at http://yourwebsite.com/my_gallery/


A: You may need to navigate to the WordPress Admin » Settings » Permalinks and re-save your site’s permalink settings.


A: This is designed for developers only.

To style your archives, you’ll need to create a new child theme template file named archive-envira.php and create the HTML and CSS to suit your needs. If you’re not sure where to start, you may want to work with a developer to achieve your goals.