Envira Gallery Documentation
Documentation, Reference Materials and Tutorials for Envira Gallery
Documentation, Reference Materials and Tutorials for Envira Gallery
Would you like to enable comments 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 comments for standalone links in Envira Gallery.
When you want to enable a comment form at the bottom of your gallery on the standalone link, just add the following code to a new file at wp-content/plugins/envira-standalone-enable-comments.php
.
<?php /** * Plugin Name: Envira Gallery - Enable Comments * Plugin URI: https://enviragallery.com * Version: 1.0.0 * Author: Envira Gallery Team * Author URI: https://enviragallery.com * Description: Enables comments for Envira CPT */ function envira_standalone_enable_comments( $post_args ) { $post_args['supports'][] = 'comments'; return $post_args; } add_filter( 'envira_gallery_post_type_args', 'envira_standalone_enable_comments' ); function envira_standalone_comments_metabox( $ids ) { $ids[] = 'commentstatusdiv'; return $ids; } add_filter( 'envira_gallery_metabox_ids', 'envira_standalone_comments_metabox' );
If you’re unsure how to create a plugin file, follow these steps below:
envira-standalone-enable-comments.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.
Your last step is to make sure you’ve set up your gallery to allow comments on your standalone link.
Click the Screen Options panel and enable the Discussions option.
Also be sure to click the checkbox to Enable Comments that will show under the gallery’s configuration information.
And that’s it! You’ve now enabled comments for standalone links on Envira galleries!
You can extend Envira further with other such changes. Take a look at our tutorial on How to make the gallery titles in your Envira Albums link.
A: Absolutely! To enable this for albums as well as galleries, use the code shown below instead of the code above and follow the same steps for creating the plugin and activating the plugin.
<?php /** * Plugin Name: Envira Gallery - Enable Comments * Plugin URI: https://enviragallery.com * Version: 1.0.0 * Author: Envira Gallery Team * Author URI: https://enviragallery.com * Description: Enables comments for Envira galleries and albums */ function envira_standalone_enable_comments( $post_args ) { $post_args['supports'][] = 'comments'; return $post_args; } add_filter( 'envira_gallery_post_type_args', 'envira_standalone_enable_comments' ); add_filter( 'envira_albums_post_type_args', 'envira_standalone_enable_comments' ); function envira_standalone_comments_metabox( $ids ) { $ids[] = 'commentstatusdiv'; return $ids; } add_filter( 'envira_gallery_metabox_ids', 'envira_standalone_comments_metabox' ); add_filter( 'envira_albums_metabox_ids', 'envira_standalone_comments_metabox' );