Skip to Content
PluginsLW Slider

LW Slider

Lightweight responsive slider for WordPress. Powered by Splide.js.

Overview

Requires WordPress6.0+
Requires PHP8.2+
Tested up to6.7
LicenseGPL-2.0-or-later
GitHublwplugins/lw-slider 

Installation

composer require lwplugins/lw-slider

Or upload the lw-slider folder to /wp-content/plugins/ and activate through the Plugins menu.

Features

  • Custom Post Type based slider management
  • Drag & drop slide ordering
  • Background image or color per slide
  • Content overlay with headline, subheadline, description
  • Call-to-action: full slide link or button
  • Splide.js powered - lightweight and accessible (~30KB)
  • Responsive: separate mobile/desktop min-height
  • Autoplay, loop, fade/slide transitions
  • Keyboard navigation and swipe support
  • Accessibility: prefers-reduced-motion support
  • Duplicate slider with one click
  • Hide on mobile option
  • Gutenberg block with slider selector and per-block override settings
  • No bloat, no upsell, no tracking

Shortcodes

ShortcodeDescription
[lw_slider id="123"]Display a slider by its post ID

You can also use the LW Slider Gutenberg block for a visual editing experience with per-block override settings.

Settings

Manage sliders under LW Plugins > Sliders. Each slider is a custom post type with:

  • Drag & drop slide ordering
  • Per-slide settings: background image/color, content overlay, CTA
  • Slider settings: autoplay, loop, transition type, min-height (mobile/desktop)

AI Abilities

When used with LW Site Manager, the following abilities are available for AI agents. All abilities are registered under the slider category and require manage_options capability.

lw-slider/list-sliders (readonly)

List all sliders registered on the site.

Input: none (empty object)

Output:

{ "success": true, "sliders": [ { "id": 42, "title": "Hero Slider", "status": "publish", "slide_count": 3, "shortcode": "[lw_slider id=\"42\"]" } ] }
FieldTypeDescription
idintegerSlider post ID
titlestringSlider title
statusstringPost status (publish or draft)
slide_countintegerNumber of slides in this slider
shortcodestringReady-to-use shortcode

lw-slider/get-slider (readonly)

Get full details for a single slider including all slides and settings.

Input:

FieldTypeRequiredDescription
idintegeryesSlider post ID

Output:

{ "success": true, "slider": { "id": 42, "title": "Hero Slider", "status": "publish", "settings": { "min_height_desktop": "400", "min_height_mobile": "280", "dots": true, "arrows": true, "arrows_mobile": false, "autoplay": false, "autoplay_delay": 5000, "transition": "slide", "loop": true, "content_align_h": "center", "content_align_v": "center", "use_default_styles": true, "custom_class": "", "swipe": true, "keyboard": true, "pause_on_hover": false, "hide_on_mobile": false }, "slides": [ { "title": "", "active": true, "bg_type": "image", "bg_image_id": 123, "bg_color": "#f0f0f0", "bg_position": "center center", "overlay_color": "", "overlay_opacity": 50, "headline": "Welcome", "subheadline": "Subtitle here", "description": "", "link_url": "https://example.com", "link_target": "_self", "cta_mode": "full_slide", "button_text": "", "image_alt": "" } ] } }

Slider Settings Fields:

FieldTypeDefaultDescription
min_height_desktopstring"400"Minimum height in px on desktop
min_height_mobilestring"280"Minimum height in px on mobile
dotsbooleantrueShow navigation dots
arrowsbooleantrueShow navigation arrows on desktop
arrows_mobilebooleanfalseShow navigation arrows on mobile
autoplaybooleanfalseEnable autoplay
autoplay_delayinteger5000Autoplay delay in milliseconds (1000-30000)
transitionstring"slide"Transition type: slide or fade
loopbooleantrueLoop slides infinitely
content_align_hstring"center"Horizontal content alignment: left, center, right
content_align_vstring"center"Vertical content alignment: top, center, bottom
use_default_stylesbooleantrueInclude bundled frontend CSS
custom_classstring""Additional CSS class for the slider wrapper
swipebooleantrueEnable touch/swipe navigation
keyboardbooleantrueEnable keyboard navigation
pause_on_hoverbooleanfalsePause autoplay on mouse hover
hide_on_mobilebooleanfalseHide the slider on mobile devices

Slide Fields:

FieldTypeDescription
titlestringInternal slide label (not displayed)
activebooleanWhether the slide is visible
bg_typestringBackground type: image or color
bg_image_idintegerAttachment ID for background image
bg_colorstringHex color for solid background
bg_positionstringCSS background-position value
overlay_colorstringHex color for overlay (empty = none)
overlay_opacityintegerOverlay opacity 0-100
headlinestringMain headline text
subheadlinestringSecondary headline text
descriptionstringBody paragraph text
link_urlstringURL for slide link or button
link_targetstringLink target: _self or _blank
cta_modestringCTA behavior: full_slide or button
button_textstringButton label (used when cta_mode is button)
image_altstringAlt text for the background image

Error Responses

CodeHTTP StatusDescription
missing_id400The id parameter was not provided
not_found404No slider exists with the given ID

FAQ

How do I display a slider?

Use the shortcode [lw_slider id="123"] or the Gutenberg block.

What JavaScript library is used?

Splide.js - a lightweight, accessible slider library (~30KB).