Envira Gallery Documentation
Documentation, Reference Materials and Tutorials for Envira Gallery
Documentation, Reference Materials and Tutorials for Envira Gallery
Would you like to enable archives for standalone links in Envira Gallery? Enabling archives creates a list of all the galleries or albums you’ve created as a link to the gallery or album standalone link. To do so, you’ll need to create a custom plugin. This documentation will help walk you through the steps needed to enable archives for standalone links in Envira Gallery.
To enable archives for standalone galleries 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:
envira-standalone-archive-support.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 – Standalone Feature – Enable Archives plugin.
Enabling archives for standalone albums follows the same process as enabling archives for standalone galleries with a few changes to the plugin’s code. To enable archives for standalone albums 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 and Featured Image * 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_albums_post_type_args', 'envira_standalone_enable_archives');
To enable archives for standalone galleries and albums in Envira, add the code below to a new file at wp-content/plugins/envira-standalone-archive-support.php
.
<?php /** * Plugin Name: Envira Gallery - Standalone Feature - Enable Archives and Featured Image * 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_albums_post_type_args', 'envira_standalone_enable_archives'); add_filter('envira_gallery_post_type_args', 'envira_standalone_enable_archives');
And that’s it! If you’ve set a featured image on your Envira gallery or album, then the title of the gallery or album 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 the galleries and albums you’ve specified in the WordPress Admin » Envira Gallery » Settings » Standalone tab view.
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.