[simple_gallery]
The shortcode displays a gallery of images in various layouts, such as grid or carousel, with customizable options.
Product
Shortcode Attributes
There are a number of shortcode attributes available which you can use to customize the output.
GENERAL LAYOUT
- listing_only – Determines whether to display only the gallery listing.
- Default:
on. - Options:
on,off. Specify one only.
- Default:
- layout – The layout type for the gallery.
- Default:
grid. - Options:
grid,carousel. Specify one only.
- Default:
- per_row – The number of items to display per row (for grid layout).
- Default:
3. - Options:
1–6. Specify one only.
- Default:
Grid Layout
- grid_layout – The grid layout style to use.
- Default:
default-grid-layout. - Options:
default-grid-layout,grid-layout-1,grid-layout-2,grid-layout-3,masonry-layout-1. Specify one only.
- Default:
Carousel Layout
- carousel_layout – The carousel layout style to use.
- Default:
default-carousel-layout.
- Default:
- autoplay – Enables or disables autoplay for the carousel.
- Default:
off. - Options:
on,off. Specify one only.
- Default:
- slider_speed – The speed of the carousel autoplay (in seconds).
- Default:
6. - Options: Any numeric value.
- Default:
- slider_arrow – Enables or disables navigation arrows for the carousel.
- Default:
on. - Options:
on,off. Specify one only.
- Default:
- slider_dots – Enables or disables pagination dots for the carousel.
- Default:
on. - Options:
on,off. Specify one only.
- Default:
CONTENT
- lightbox – Enables lightbox functionality for images.
- Default:
off. - Options:
on,off. Specify one only
- Default:
- id – The ID of the
gallerypost type from which to retrieve the gallery images.- Options: Any numeric value. Specify one only.
Example Usage
[simple_gallery id="123" layout="grid" per_row="4"]
[simple_gallery id="123" layout="carousel" autoplay="on" slider_speed="5"]
[simple_gallery id="123" layout="grid" lightbox="on"]
Results
| Example 1: This example display a gallery in a grid layout with 4 images per row.Example 2: This example display a gallery in a carousel layout with autoplay enabled.Example 3: This example display a gallery in a grid layout with a lightbox enabled. |
id attribute corresponds to a valid gallery post type and that the post has gallery images assigned.