Comment on page
How to use Query Slider
This guide covers how you can create stunning product/post slider using block slider query feature.
You can create hassle-free product/post slider in a matter of mins with the block slider plugin.
You can enable the query mode from the starting placeholder in the block slider:
where to find "query" mode.
Once you've enabled the query mode. You can now see an additional option panel under "Slider Settings" named as "Query".
This is you can configure the query to fetch posts relevant to your needs.
additional query panel
The query panel only appears if you've entered the query mode as explained above.
The query panel contains bunch of options that allows you to configure the query as per your specific need.
Let's go through each of them in detail:
inherit query toggle
This powerful toggle allows you to inherit the global wordpress query from the template where the slider is inserted.
Inheriting global query is very powerful, and can help you achieve creating complex sliders for the following use cases:
- Archive Slider: You can insert the slider (with inherited query) on an archive page and it'll automatically iterate through the archive posts of that particular category/taxonomy.
- Results Slider: You can insert the slider (with inherited query) on search result page and it'll automatically iterate through the search result posts of that particular searched term.
post type control
WordPress contains different types of content and they are divided into collections called “Post types”. By default there are a few different ones such as blog posts and pages, but plugins could add more.
You can select the post type from which posts you need to display in the query slider.
if you're creating a product slider with WooCommerce. You need to use the "product" post type in order to fetch particular products.
max items control
As the name suggests, max items control allows you to basically control the maxiumum amount of posts the query slider can fetch.
order by control
Order by control allows you to control the fetched posts order. You can choose order from the following list
- 1.Newest to oldest: Orders post from the newest to oldest date.
- 2.Oldest to newest: Orders post from the oldest to newest date.
- 3.A -> Z: Orders post in alphabetical order based on their title from "A" to "Z"
- 4.Z -> A: Orders post in alphabetical order based on their title from "Z" to "A
sticky posts control
WordPress allows you to stick a post so that it always appears on front (first) when posts are queried.
Using this control you can control the sticky posts behaviour in the query slider:
- 1.Include: Includes the sticky posts so that they appear on top (first) when posts are queried.
- 2.Exclude: Excludes the sticky posts from the query slider
- 3.Only: Only fetches the posts that are sticky and matches the other query criteria. Selecting this option will exclude every other post that is not sticky from the query slider.
Aside from the basic query modification controls above. Block slider also allows you to filter the queried posts.
Allowing you to basically narrow down further to match your content needs.
search filter control
You can specifically search through the queried posts based on search keyword. Adding a search term here searches through the "content" and "title" of the post.
taxonomy filter controls
Taxonomy filters allows you to basically narrow down the queried posts based on the taxonomy terms.
Taxonomy filters changes based on the allowed taxonomy and the selected post type.
author filter control
You can also filter the queried posts based on the post author.
You can also further extend the query slider if you have any specific needs with the help of the following filter
Learn how you can create a WooCommerce product slider in the following guide.