Published on May 18, 2020

ACF Pro’s Gallery Field as a Slider in Oxygen using Splide

Sridhar Katakam

Updated on December 04, 2020

In the past, we published a tutorial on how to output images of a Gallery-type custom field added using ACF Pro as a responsive slider/carousel using Flickity here.

This tutorial shows how to do the same using Splide JavaScript slider.

Step 1

Install and activate ACF Pro.

Add a field group having a Gallery type of field and set it to appear on posts.

post_gallery is the name of the gallery-type field here

Step 2

Let us register a custom image size for the images in our slider.

Install and activate Code Snippets plugin.

Go to Snippets > Add New.

Title: Custom image sizes

Code:

add_image_size( 'slider_image', 480, 300, true );

Save changes and activate.

Step 3

Edit your posts and upload/select images in the Gallery field for each where needed.

We are going to set a condition on the Section in which images from the Gallery field will be pulled such that it will be output on the front end only the gallery field has been populated.

Step 4

Register custom handles for Splide's CSS and JS so they can be loaded on demand.

Install and activate My Custom Functionality plugin.

Connect to your hosting account using a FTP client and navigate to site’s /wp-content/plugins/my-custom-functionality-master.

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.

tagschevron-leftchevron-rightchainangle-rightangle-upangle-downfolder-ocalendar-check-omagnifiercrossmenuchevron-downarrow-right