Documentation, Reference Materials and Tutorials for Envira Gallery
Would you like to create a custom template to display your Envira galleries? You can create your own PHP page templates on your theme for Envira. This tutorial will walk you through how to create a custom page template for your Envira galleries.
- Create a Child Theme
- Activate the Child Theme
- Create the Custom Template
The first step will be to create a child theme.
We recommend using a child theme for any edits you wish to make to your theme. This ensures that if the theme pushes out an update, you’ll not lose any changes you’ve made to your theme.
To create a child theme, follow the instructions here from our friends at WP Beginner.
Next, navigate to Appearance » Themes and activate your new child theme.
Now that your child theme is activated, we can create our custom page template.
In this example, we’re going to copy the
page.php inside the WordPress Twenty Seventeen theme and use this for our Envira galleries custom template following these steps:
- Open the
- Open the
page.phptemplate from the parent’s theme directory using any code editor you choose.
- We’ll need to remove the comments from the top of that page template and replace it with:
/* Template Name: Envira Gallery Page Template */
- Finally, just save the file using this name
Your Standalone galleries will now use your custom template automatically!
Would you like to do the same for Envira Albums? Check out our tutorial on How to Create a Custom Template for Albums!
A: You can do this with CSS to hide any sidebars for that particular page template. If you need any assistance, reach out to support to inquire about some assistance with this.
A: Not necessarily! This will depend on the theme you’re using and if your theme has provided any custom templates. You can read more about that on our How to Use the Standalone Feature in Envira Gallery.