The Slider layout creates interactive carousels with navigation controls, thumbnail navigation, multiple transition effects, and extensive customization options.
Overview
Slider layout transforms your portfolio into an interactive carousel, perfect for showcasing featured work, creating image galleries, or building homepage hero sections. It includes support for multiple slides per view, various effects, and flexible navigation options.Key Features
- Multiple transition effects: Fade, slide, coverflow, and more
- Flexible navigation: Arrows, bullets, thumbnails, or combination
- Multiple slides per view: Show 1 or more slides at once
- Auto-play support: Automatic slideshow with customizable timing
- Thumbnail navigation: Visual thumbnail navigation strip
- Responsive controls: Touch-enabled with swipe gestures
- Dynamic heights: Support for auto, fixed, or percentage-based heights
Configuration Options
Slides Per View
Number of slides visible at once. Use
"auto" for dynamic sizing based on content.1- One slide (classic slider)2- Two slides side-by-side3- Three slides"auto"- Automatic sizing based on slide content
Items Height
Height of slider items. Can be pixels, percentage, or viewport height.
"auto"- Dynamic height based on content"400"- Fixed pixel height (400px)"60%"- Percentage of container width"80vh"- Viewport height units
Items Min Height
Minimum height for slider items. Useful when using dynamic heights.
"300px"- Minimum 300 pixels"40vh"- Minimum 40% viewport height
Transition Effect
Visual transition effect between slides.
slide- Classic horizontal slide (default)fade- Smooth fade transitioncoverflow- 3D coverflow effectflip- 3D flip animationcube- 3D cube rotation
Thumbnails
Number of thumbnails visible in the thumbnail navigation.
Height of thumbnail strip.
Gap in pixels between thumbnails and main slider.
Navigation Options
The slider supports three types of navigation that can be used independently or together:1. Arrows Navigation
Previous/Next arrow buttons:- Template:
templates/items-list/layouts/slider/arrows.php - Appears on hover by default
- Customizable positioning and styling
2. Bullets Navigation
Dot indicators showing current slide:- Template:
templates/items-list/layouts/slider/bullets.php - Positioned below slider
- Clickable for direct navigation
3. Thumbnails Navigation
Visual thumbnail strip:- Template:
templates/items-list/layouts/slider/thumbnails.php - Shows preview of all slides
- Synced with main slider
- Supports multiple thumbnails per view
Implementation Details
Dynamic Height Calculation
For percentage-based heights, the slider uses ResizeObserver:Height Modes
Auto Slides Per View:Usage Examples
Basic Slider
Fade Effect Slider
Multi-Slide Carousel
Slider with Thumbnails
Full-Height Hero Slider
Gutenberg Block
In the Block Editor:- Add Visual Portfolio block
- Select Slider layout
- Configure slides per view
- Choose transition effect
- Set height options
- Enable navigation (arrows, bullets, thumbnails)
- Adjust autoplay settings if desired
Responsive Behavior
Slider automatically adapts to different screen sizes:- Desktop: Full settings as configured
- Tablet: May reduce slides per view
- Mobile: Usually shows 1 slide per view
- Touch devices: Enables swipe gestures
Best Practices
When to use Slider layout
When to use Slider layout
- Homepage hero sections
- Featured work showcases
- Before/after comparisons
- Product galleries
- Testimonial displays
- Image galleries with many photos
Height recommendations
Height recommendations
- Use percentage heights (50-80%) for responsive design
- Set min-height to prevent too-small sliders
- Avoid viewport heights in Gutenberg preview
- Test on actual devices for best results
Performance optimization
Performance optimization
- Use lazy loading for image-heavy sliders
- Optimize image sizes before uploading
- Limit auto-play speed to prevent jarring transitions
- Consider fewer slides per view on mobile
Accessibility considerations
Accessibility considerations
- Always provide navigation arrows
- Ensure sufficient color contrast
- Test keyboard navigation
- Provide alt text for all images
Common Issues
Effect Examples
Slide Effect (Default)
Classic horizontal sliding between items.Fade Effect
Smooth opacity transition. Best for full-width hero sliders.Coverflow Effect
3D carousel with perspective. Great for showcasing albums or products.Flip Effect
3D flip animation between slides. Eye-catching but use sparingly.Cube Effect
3D cube rotation. Works best with square images.Combining with Features
Slider works with:- Item Styles: Add overlays to slides
- Lightbox: Open slides in full-screen
- Filters: Filter slider content (updates slides)
- Auto-play: Automatic slideshow functionality
Advanced Customization
For developers:Available Slider Templates
- Arrows:
templates/items-list/layouts/slider/arrows.php - Bullets:
templates/items-list/layouts/slider/bullets.php - Thumbnails:
templates/items-list/layouts/slider/thumbnails.php
Related Layouts
Grid Layout
For static grid galleries
Tiles Layout
Custom tile patterns
Source Code Reference
- JavaScript:
assets/js/layout-slider.js:1 - ResizeObserver:
assets/js/layout-slider.js:8 - Height Calculation:
assets/js/layout-slider.js:31 - Arrows Template:
templates/items-list/layouts/slider/arrows.php - Bullets Template:
templates/items-list/layouts/slider/bullets.php - Thumbnails Template:
templates/items-list/layouts/slider/thumbnails.php