Multiple Popups on a single Post/Page
Add multiple responsive YouTube & Vimeo Video Popups to a single post/page with WP Video Popup PRO. To do that, we give each shortcode a unique ID that, at the same time, works as the CSS class to trigger/open the lightbox.
In the example below we add 2 Popups to a single page. The first video is a YouTube video while the second one is hosted on Vimeo. Here’s what the code would look like:
[wp-video-popup id="video1" video="https://www.youtube.com/watch?v=YlUKcNNmywk"]
<a class="video1" href="#">Play Video 1</a>
[wp-video-popup id="video2" video="https://vimeo.com/136696258"]
<a class="video2" href="#">Play Video 2</a>
If you’re not going to have multiple popups on a single page with the PRO version, the regular shortcode needs to be used. See Basic Usage
Autoplay on Page Load
You may want to show a video to your visitors right after page load. To do that, add the
autoplay parameter to your shortcode like this:
[wp-video-popup autoplay="1" mute="1" video="https://www.youtube.com/watch?v=YlUKcNNmywk"]
Due to recent changes in the autoplay policy, some browsers require the video to be muted to play automatically. To mute the video, add the mute attribute to the shortcode as shown in the example above.
Please note that this method may not match the GDPR guidelines.
If you have multiple videos on a single page/post, you can load a specific video on page load by adding the following parameter to your URL:
Make sure to replace
videoid with the actual ID specified in the shortcode.
The PRO version allows you to group videos into galleries so that the visitor doesn’t need to exit the popup to view the next video. They can simply use the arrows to navigate through the available videos of the specified gallery.
To group specific videos into a gallery, simply add the gallery attribute to your shortcode. Here’s an example:
[wp-video-popup id="galleryvideo1" gallery="mygallery" video="https://www.youtube.com/watch?v=YlUKcNNmywk"]
[wp-video-popup id="galleryvideo2" gallery="mygallery" video="https://vimeo.com/136696258"]
<a class="galleryvideo1" href="#">Play first video of gallery "mygallery"</a>
To change the size of your video & overlay background color, navigate to Settings -> WP Video Popup in your WordPress admin.
The Popup size field is not restricted to px, you can enter a value like 80% as well.