Dynamic sliders show content from posts and custom types. With Toolset, you can create sliders for any content type, with any field and with your design.
You’ll use the View block to create dynamic sliders with Toolset. This way, you have full control over which content to query and the appearance of the sliders. Each slide can contain one or several items, with fields, links and anything else that you need.
As sliders usually feature images, be sure to check out our detailed lesson about displaying images with Toolset.
- To start, edit or create a page, post or a template and insert the View block.
- In the View-creation wizard, enable pagination and in the Select View Loop Style section, choose the Unformatted (last) option.
- In the last step of the wizard, select the post type for which you want to display posts.
- Click to finish the wizard and your View is ready.
- Insert a Container block so you can add a background to your slider. For example, you can set the slide’s background to be a dynamic image coming from the post’s featured image.
- Use Toolset blocks to add other dynamic fields to your slider, like the post title.
- Click to select the main View block.
- In the right sidebar, expand the Pagination section.
- Select the Pagination enabled with automatic AJAX transition option.
- In the Items Per Page dropdown, select 1. You can also tweak other options like the transition effect and duration.
- Click to select the View’s Pagination block.
- In the right sidebar, change pagination controls from numbers to dots.
- Additionally, you can expand the Advanced section and center align the pagination controls.
Toolset comes with a big collection of blocks to display dynamic sources (custom fields, WordPress fields, and taxonomies). However, you can also display Dynamic Sources using WordPress core blocks and popular block plugins.
Use the following steps to display a Dynamic Source in any supported block:
- Insert or select a block.
- In the right sidebar, expand the Dynamic Sources section.
- Toggle on the option for any of the supported fields in that block.
- Use the dropdowns that appear to select the dynamic source you want this block to display for that field.
Toolset allows you to display Dynamic Sources, like custom fields, inside any text blocks like headings, buttons, and more. This includes WordPress core blocks, Toolset blocks, and popular block plugins.
To display any Dynamic Source inline, insert or select a block with a text input and look for the Inline Fields button. Dropdown menus will appear, allowing you to select a Dynamic Source.
For more information, check out the lesson about displaying Inline Fields.
By default, your slider displays all posts belonging to the post type that you selected when creating the View.
However, sliders are mostly used to highlight special, featured content. This is why you will probably want to add a filter so that your slider displays only selected posts.
You can filter a slider’s output by custom fields, taxonomies, standard post fields, post relationships, and more.
Use the following steps to add a filter to your slider:
- Click to select the main View block.
- In the right sidebar, expand the Query Filter section.
- Click Add a filter and in the dialog that appears, select what to filter by.
- In the right sidebar, select the options for your filter.
Create custom lists of posts
- Styling Custom Searches
- Styling Views and Archives
- Adding Custom CSS to Templates, Archives and Views
- Passing Arguments to Views
- Show all related topics...
- Display Dynamic Sources Inside all Text Blocks
- Displaying Form Data
- Displaying a List of Posts on A Map
- Adding Dynamic Content to Your Homepage
- Creating a View
- Sliders of Static Images for Pages
- Dynamic Galleries and Sliders for Templates, Displaying Repeating Image Fields
- Creating Responsive Columns and Grids
- Display Content Conditionally
- Using Third-Party Hidden Fields