Fork it, or download the latest release, and make it your own!
This is a demonstration of how you might create a custom ACF Block, which is a slider carousel UI. We're using SwiperJS (3rd-party dependency) for the slider JavaScript and CSS (mostly).
Required You must have ACF PRO installed and activated in order to use the ACF Slider Block plugin.
- Upload the
acf-slider-block
folder to the plugins directory (typicallywp-content/plugins
) in your WordPress installation. - Activate the ACF Slider Block plugin.
- Create a new post or page, and insert the Slider block.
- That's it.
Squash the bugs 🐛
- Adjust
z-index
for 'Add Slide' button in editor for easier clicking. - Adjust placeholder, default image paths for resilience.
- Remove unnecessary
console.log()
Initial release, which includes:
- Slider Block which uses SwiperJS (v11.0.4)
- Two style variations: "Default" and "Complex" - examples of how you might have different variations. Feel free to fork and modify!
- Need help converting your block markup to PHP nested arrays or JS objects? Check out WPHTML Converter
- Download and include the latest SwiperJS from JSDelivr.com.
- Developer.WordPress.org - 'Metadata in block.json'
- Developer.WordPress.org - 'Supports'