In this post, I’m going to show you how to create a flexible and searchable WordPress video gallery using the Document Library Pro plugin from Barn2.
Using this plugin, you can add videos to your gallery using 3 different methods:
- Embedding videos from a third-party service like YouTube, or Vimeo.
- Uploading videos directly to your WordPress website.
- Creating a video playlist.
Let’s start with some real use cases for these types of video galleries.
Here Are Some Examples Of Use Cases For Video Galleries
While you can probably think up plenty of creative uses outside of this list, some of the most common ways to use a WordPress video gallery are…
A Video Portfolio
If you make videos for a living, that’s a pretty good reason to want to showcase your work. But there are plenty of other professions that might be better off with a video gallery portfolio as well.
A Playlist Of Videos
Whether they’re your own videos or you just want to create a playlist from other people’s videos, a video gallery gives you the power to display the exact information that you want and put the videos in a specific order.
A Video Sharing Site
If you have a video sharing site, a video gallery lets you do cool things like:
- Display the latest videos in one spot
- Showcase featured videos in one spot
You can then even direct your users back to the full post that contains that video.
How To Create A WordPress Video Gallery With Document Library Pro
While some regular WordPress gallery plugins let you include videos, the Document Library Pro plugin is actually a great option to create WordPress video galleries because:
- It gives you exact control over what information you display (or don’t display).
- Your visitors will be able to sort your videos by tags, categories, or even search for keywords.
- You can customize the look of your feed to match your website.
Basically, most of the pre-made WordPress gallery plugins are fairly one-size-fits-all, while Document Library Pro is going to give you a lot more control over how you display things (it’s got over 50 options!).
Videos will automatically play in an online video player, within your video gallery page. You can also set your videos to play on a separate page or redirect users to watch the video on the original platform (e.g. YouTube).
Step 1: Install the Video Gallery Plugin
Start off by installing Document Library Pro on your WordPress website.
Next, enter the license key which you will received in your “Getting started” email.
In your WordPress dashboard, go to Document Libraries to choose how you want your video gallery to look.
Here you can adjust the following settings:
- Columns – The plugin gives you a number of options for column data. For this particular use case, I suggest
content:Watch Now, title, excerpt, doc_categories. The text “Watch Now” will appear as the column header. If you’re importing videos from a platform like YouTube, you might prefer to direct users to the original source. For this, add the
- Clickable columns – By default, Document Library Pro allows website visitors to click on the video title and watch it on a separate page. If you want to disable this, add
- Shortcodes – Enable this option to allow the video gallery page to display video players.
- Filters – By selecting Custom you can add
excerptto display the video tags, category and description. This is a great way to help visitors find specific videos in your gallery.
- Lazy load – If you’re showing a large number of videos, enable lazy load to improve your page load time.
Step 2: Add Videos To Your Gallery
Next, you need to add the videos that you want to display by going to Documents → Add New. This new document functions just like any regular WordPress post.
Next, follow these two steps:
- Enter the video’s title and any other information (in this case, the tag, category, and excerpt).
- Embed your video in the main content area. To do so, you can use one of the following three methods.
Method 1: Embed a Video from YouTube or Vimeo
Hosting a large number of videos on your own server is generally a pretty horrible idea, that functionality isn’t very useful in most situations.
Instead, if you’re like most people, you’re probably embedding videos from a third-party service like YouTube, Vimeo, or Wistia.
To embed your video, all you need to do is copy and paste the video URL into the content area of your WordPress document.
Method 2: Uploading Videos Directly to Your WordPress Website
If you prefer to host the videos yourself, upload your videos to your Media Library. Make sure to select Embedded Media Player under the Attachment Display Settings section.
Next, insert the video into the content area of your WordPress document.
Method 3: Creating a Video Playlist
To add a video playlist, your videos will have to be hosted on your WordPress website. Once your videos are uploaded to your Media Library, follow these steps:
- Select Add Media.
- Click on Create Video Playlist on the left hand side of the popup box.
- Tick the videos you want to include.
- Click on Create a new video playlist.
- Add a caption for each video and tick the boxes to indicate whether to show the video list and images.
- Click on Insert video playlist.
Step 3: Display Your Video Gallery Using Document Library Pro
At this point, your document/s have been created.
Document Library Pro automatically sets up a page showing your video gallery right away. To view it, navigate to the Pages tab in the WordPress dashboard. Search for the page entitled “Document Library”.
Edit the page and you will notice that it has the shortcode
[doc_library] in the main content area.
You can either use this automatically-generated page or display your video gallery anywhere on your WordPress website.
You’ll do this using a shortcode.
As we already saw, the basic shortcode looks like this:
This shortcode will use the global options that you selected in Step 1. You can then use the shortcode options to control each video gallery individually.
For a more detailed explanation of all the options available to you, I recommend that you check out the developer’s post on displaying documents on your website, as well as the full list of shortcode parameters.
Here’s an example of how to set your column widths:
Add Links, Buttons & Icons to Your Table
Document Library Pro lets you take your video gallery that extra step through the use of links, buttons and icons.
You can configure the link style globally on the plugin settings page, or directly in the shortcode as follows:
Creating Multiple Video Galleries
The default shortcode displays all your videos in one table. You can, however, create separate video galleries for different videos.
The easiest way to do this is to separate your videos by category. Then, append the text
doc_category="categoryname" to your shortcode.
This will bring in all the videos from the ‘product’ category.
Final Thoughts On Building A WordPress Video Gallery
If you just want to throw up a basic WordPress video gallery and are fine with accepting a plugin’s one-size-fits-all design, this method might be a bit overkill.
But if you want to create a video gallery that you have full control of, setting it up like this is going to give you pinpoint control over how everything looks and functions.
Have any other questions about how to create a WordPress video gallery with Document Library Pro? Leave a comment and we’ll try to help out.