Opens in a new tab
3rd Oct '22
/
0 comments

Custom Meta Box Thumbnail Slider in WordPress

This Pro tutorial provides the steps to set up an image and YouTube video thumbnail slider in WordPress using Splide and Meta Box.

The site owner/editor will be able to select/add any number of images and YouTube videos (URLs) and these will appear as individual slides in the sliders.

We are going to create a MB field group that has these fields:

Photo or Video? - Group|_Pick one - Button Group (Photo and Video buttons)|_Photo - Single Image (appears when Photo button is clicked)|_Video - Group (appears when Video button is clicked)|___URL - URL|___Thumbnail Image - Single Image

We are also adding a field for video thumbnail which will be output if set, otherwise, the video's thumbnail will be fetched and shown.

While the steps below are for Bricks, this tutorial can be implemented with a few changes in any WP site.

Step 1

Install and activate Meta Box and its AIO extensions.

If you would like to follow along, create a Page called "Composite Meta Box Thumbnail Slider" and import this (mirror) field group.

If you would like to create the fields yourself, add a new field group named say, "Thumbnail Slider" and refer to the above video. Attach the field group to your desired location. In this example, it is a static Page. Set a Field ID prefix so the field IDs can be kept simple.

Step 2

Edit your Page and populate the fields.

Step 3

Set/edit titles for your images either in the Page edit screen or in the Media Library since we are going to show them overlayed near the bottom on the image slides.

Step 4

In Bricks' Settings, check "Generate custom image sizes" or alternatively add the following in child theme's functions.php or a code snippets plugin:

add_image_size( 'bricks_large_16x9', 1200, 675, true );

Regenerate thumbnails.

Edit your Page with Bricks.

Add a Section and inside the Section's Container, a Code element.

Set max width to 1200px and left and right margins to auto to center it horizontally.

Paste this code in:

This is a BricksLabs Pro tutorial.

For full access login below or create your BricksLabs Pro account

Get access to all 634 Bricks code tutorials with BricksLabs Pro

Related Tutorials..

Pro
Meta Box Relationship in Bricks using Posts Query Loop

Meta Box Relationship in Bricks using Posts Query Loop

This Pro tutorial is similar to the recent ACF Relationship in Bricks using Posts Query Loop guide but for Meta Box. In the past, we…
Categories:
Pro
Conditional Rendering Based on Current Date and Time in Bricks when Using Meta Box

Conditional Rendering Based on Current Date and Time in Bricks when Using Meta Box

A Pro member of our site asks: Using bricks + Meta, conditionally show a post listing under 3 different conditions, based on the Current Date…
Pro
Bricks Forms + Meta Box: Auto-Create Post Relationships on Form Submission

Bricks Forms + Meta Box: Auto-Create Post Relationships on Form Submission

How to link a Bricks post-creation form on a post to a newly created post of another post type using Meta Box relationship.
Pro
Sort Posts by Meta Box Group Sub Field in Bricks

Sort Posts by Meta Box Group Sub Field in Bricks

This Pro tutorial provides the steps to order posts in Bricks by the value of a Number-type of sub field that is inside a Meta…
Pro
Ken Burns Background Slideshow in Bricks

Ken Burns Background Slideshow in Bricks

Setting up a hero section, having images that pan and move as a background slideshow with content on top.
Categories:
Tags:
Filtering Bricks Posts Query Loop by Meta Box Group’s Radio Subfield Value

Filtering Bricks Posts Query Loop by Meta Box Group’s Radio Subfield Value

In the past we showed how a Bricks posts query loop can be filtered by Meta Box group's subfield of types text/number and Datepicker here.…
Categories:
Pro
Dynamically Displaying Connected Content Offer Images in Bricks using Meta Box Relationship

Dynamically Displaying Connected Content Offer Images in Bricks using Meta Box Relationship

Consider the following scenario from a recent project I worked on. CPT 1: project CPT 2: content-offer Taxonomy for Projects: remodel-typeSample term names: Backyard Cottages…
How to Create a Right Overflow Effect on Sliders in Bricks

How to Create a Right Overflow Effect on Sliders in Bricks

In this tutorial, we'll learn how to recreate a nice overflow effect on the right of our sliders in Bricks. Introduction Recently, I've been asked…
Categories: