In this members-only tutorial, we shall build a custom YouTube video carousel with videos playing in a lightbox when the thumbnail is clicked by
- registering a Custom Post Type called `video` having a `video_url` custom field
- adding video entries while providing the URL of a YouTube video in each
- adding a Code Block in Oxygen with the code to output the video entry image (featured image and if not present, video thumb from YouTube), title and URL using a custom WordPress query and loop, initializing Owl carousel on the videos container and adding the necessary CSS
Step 1Install and activate my custom functionality plugin. Upload owl.carousel.min.css and owl.theme.default.min.css to the plugin's
assets/cssdirectory and owl.carousel.min.js to plugin's
assets/jsdirectories via a FTP client.
Step 2Install and activate Pods. Add a new
videopost type. Add a
video_urlWebsite type custom field. In the Advanced Options tab, tick "Featured Image" under Supports. Save the pod.
Step 3Let's load the CSS and JS files of Owl on the page where the slider is to be shown (homepage in this example) and register a custom size for images in the carousel. Edit plugin's
plugin.phpfile. Replace the code inside
This is a premium members-only content.
To view the rest of the content, please sign up for membership ($47/month or $499 one-time).
Already a member? Log in below or here.