Wypo Logo Header@2x
Documentations / Gutenberg Slider

Gutenberg Slider

This plugin adds a "Slider" block to the Gutenberg editor. It works with the OwlCarousel library. The "Slider" block can contain different slides with free content or using posts (pages or CPTs).

Requirements

  • WordPress : Version 5.9 or higher
  • PHP : Version 7.0 or higher

Installation

To install the plugin, please refer to the “Installing a plugin” documentation.

Example

Free content

From posts (Query)

Block parameters

  • Number of slides to display
  • Looping slider
  • Autoplay
  • Autoplay speed
  • Center first slide
  • Show pagination (dots)
  • Show navigation (prev, next)
  • Responsive: to modify the following parameters according to screen size:
    • Number of slides to display
    • Show pagination (dots)
    • Show navigation (prev, next)

Query

When creating a slider from posts, a query block is added to manage query parameters (content type, sorting, filters). This block contains the publication template block, enabling you to adjust the content of the slides.

The rendering in the back-office does not reflect the rendering on the site.

  • Publication type
  • Elements per page – Number of slides
  • Offset in query
  • Order
    • Order by – To order by meta value or randomly, see “Customization” section
    • Order (ASC or DESC)
  • Filters – Depending on the type of publication selected, allows filtering by associated taxonomy – if no taxonomy, the parameter is not displayed.

Personalization

Breakpoints

By default, the plugin adds the following breakpoints:

PHP

Add a breakpoint

PHP

Edit a breakpoint

PHP

Delete a breakpoint

PHP

Texts

Previous and next buttons

PHP

Sorting for sliders from posts

Ordonner par meta value

By default, the WordPress Rest API doesn’t support requests using meta values. To enable them, copy the following code into your theme’s functions.php file:

PHP

The function allows meta values for pages, but “page” must be replaced by “post” or a CPT slug for other types of content.

Random order

This functionality is not activated by default in the Worpress API Rest. Copy the following code into your theme’s functions.php file to activate it:

PHP

For other types of content, replace “page” with “post” or a CPT slug.