Digital Photography Tips, Tutorials and Resources
Do you want to sort the photos in your image galleries? Sometimes you want to filter your images by title, filename, published date, etc. In this article, we will share how to sort images in WordPress galleries.
By default, WordPress does not allow you to sort images in galleries. However, you can sort your gallery images using Envira Gallery plugin. Lots of different filtering options are available in one simple dropdown menu, so it’s quick and easy to arrange your photos.
To sort images in WordPress galleries, you’ll need to follow these 4 steps:
- Step 1. Install and activate Envira Gallery plugin
- Step 2. Create an image gallery in Envira
- Step 3. Edit gallery settings to sort images in WordPress
- Step 4. Add your sorted image gallery to a post or page
Ready to get started? Let’s go!
Step 1: Install and Activate Envira Gallery Plugin
To begin with this tutorial, you need to install and activate Envira Gallery WordPress plugin.
If you need help with the installation, check out our guide on how to install Envira Gallery.
Step 2: Create an Image Gallery in Envira
Upon activating the plugin, you can go to Envira Gallery » Add New to add a new image gallery in WordPress.
Go ahead and add your images into the Native Envira Gallery section. (We’ll sort these photos in the next step.)
After adding your images, you’ll need to hit the Publish button to save your changes. Copy the shortcode to your clipboard from the Envira Gallery Code widget– we’ll use this code to display our image gallery.
For more help with this step, check out our guide on how to create an image gallery with thumbnails in WordPress.
Step 3: Edit Gallery Settings to Sort Images in WordPress
Next, it’s time to sort our images. After creating your new image gallery, go to the Config tab. In the Sorting dropdown, you can choose any one filter to sort your images. The options include random, published date, filename, title, caption, alt, and URL.
(I chose Filename, so my images will be sorted alphabetically by their filename.)
Step 4: Add Your Sorted Image Gallery to a Post or Page
To add your sorted image gallery to a post or page, you can go to Posts/Pages » Add New or edit an existing post.
Now, simply paste the shortcode that you copied in the previous step into the visual editor. Make sure to hit the Update button to save your changes.
That’s it! Now your sorted image gallery is live on your website.
We hope this article has helped you to learn how to sort images in WordPress galleries. You may also want to check out our guide on how to add pagination in WordPress image galleries.