How The New Query Loop Block in WordPress 5.8 Compares to the Toolset View Block
WordPress 5.8 includes the first feature towards Full Site Editing – the new Query Loop block. In this post, we compare between the Query Loop block and Toolset’s View Block.
The purpose of the new Query Loop block is to load content from the database and display it as a list of items. As this is very similar to the description of our View block, we thought that it would help to compare the two blocks and see what’s common and where the two differ.
How the New Query Loop Block Works
Query Loop displays posts from any post type on your site, including custom post types.
You can currently insert it into the body of posts or pages. Once Full Site Editing comes to WordPress, it will be possible to insert this block into templates for archive pages and single-post templates.
When you insert the Query Loop block, it displays standard WordPress posts by default. First, you select the layout for displaying the posts or click to start designing from scratch.
Once you select the layout, the Query Loop block switches to “editing mode”.
Query Loop block acts as a container into which you insert blocks. Because of this, the List view panel on the left shows you the structure and all blocks inside the Query Loop block.
As you can see, there is a special block called Post Template. It is nested just under the Query Loop block. In essence, the Query Loop block pulls content from the database and the Post Template block handles the output.
Adjusting the Query Options
By selecting the Query Loop block, you can tweak different query options in the sidebar, including:
- Post type selection
- Sticky posts display
- Filters (manual selection of categories, author, or keywords)
By clicking the blocks Display settings button, you can tweak additional settings, including:
- Items per Page
- Max page to show
As mentioned above, the carousel view allows you to select one of the predefined layouts.
Here are a few examples of different carousel layouts you can choose from.
The Query Loop block also supports custom, predefined layouts you can use as Patterns.
When inserting a block, click the Browse all button, and in the panel that appears, click the Patterns tab. In the dropdown, select Query and select one of the patterns that appear.
The ability to use Patterns for predefined layouts is interesting as it opens up a possibility for theme and plugin authors to come up with creative design ideas.
Displaying Dynamic Content
A list of posts only makes sense if you can display dynamic content coming from those posts. WordPress uses dedicated blocks for displaying different post fields inside a Query Loop.
There are currently 7 new blocks you can use to display dynamic content in a Query Loop block:
- Post Title
- Post Content
- Post Date
- Post Excerpt
- Post Featured Image
- Post Categories
- Post Tags
There are currently two major limitations when designing a Query Loop:
- There are virtually no design options for these dynamic blocks
- There is currently no way to display custom fields
At the time of writing this article, there is no information or discussion of introducing such features. We can only wait and see how this goes in the future.
How Does Query Loop Block Work With Themes?
Thankfully, the new Query Loop block works fine with all Toolset recommended themes like Astra, Blocksy, Kadence, Page Builder Framework, and OceanWP.
If you use the Query Loop block and run into some display and styling glitches, it’s best to check with the theme’s authors.
Toolset’s Unique Approach to Dynamic Content
While WordPress now has dedicated blocks for different fields (with blocks for custom fields yet to arrive), Toolset does something completely different. It allows displaying the value coming from any field, inside any block. This means that you can display fields in different ways and also combine them together.
Here is the Toolset Heading block with options for displaying dynamic content and styling:
Using dynamic content in the Toolset Heading block
Styling options in the Toolset Heading block
And here is a list of fitness clubs on the front-end, created with Toolset’s View and with the WordPress Query Loop block:
Query Loop block
Toolset Views block
As you can see and we already mentioned, Query Loop cannot even display custom fields. Also, you cannot really adjust any styling or options so they are simply inherited from the theme.
It’s clear that the Toolset version looks cleaner and better organized. This is because, with Toolset, we use “regular” blocks that offer complete styling options. The WordPress Query version uses dedicated dynamic blocks, which are missing most styling features and don’t allow combining several fields into a block.
When Is It a Good Idea To Use The WordPress Query Loop Block and When Should I Use Toolset’s View?
As you can see, the WordPress Query Loop block is still in its infancy. You could use it for doing really simple lists of content, for example:
- Show recent posts on your homepage
- Show testimonials on your homepage (testimonials are a custom post type)
- Show portfolio items on one of your pages (portfolio is a custom post type)
- Show a list of posts from a specific category on your homepage
On the other hand, you will need the Toolset View block for anything else. These are the most common and important View block features that the Query Loop block is missing:
- Display custom fields in your list of posts
- Customize the styling of displayed fields
And of course, there are many more advanced, but crucial features you will often need:
- Filter posts by anything (and not just categories and tags)
- Add a custom search
- Display parts of the list conditionally
- Display posts on a map
- Display related posts
- Display posts using a masonry or collage layout
And many more.
As you can see, the new WordPress Query Loop block has a long way to go before it really becomes usable for typical websites. We can probably expect to see more features introduced to it once the Full Site Editing arrives. This is currently slated (but could change) for the end of 2021.
At the moment when you need to create a fully functioning and customized list of content in WordPress, the Toolset View block is still the far best solution out there.
Did you try the Query Loop block? What do you think of its current features? What do you expect to come in the future?
Share your thoughts and we’ll reply!