The online world is buckled up for WordPress 5.8, which is one of the most jam-packed WordPress releases in a while.
While the Query Loop block hasn’t come under the spotlight, it is one of the most powerful features to look forward to in the latest WordPress update.
Read on to learn more about WordPress’ Query Loop block.
Query Loop 101
You can think of the Query Loop block as an advanced version of the Latest Posts block.
The advantage of the Query Loop block over the Latest Posts and Post Lists blocks is that it does not require PHP code.
The Query Loop block comes with six pre-configured layouts to choose from — standard, image at left, small image and title, grid, large title and offset.
Query Loop: What You Can and Can’t Do
Using the Query Loop block, you can display:
- Recent posts on your homepage
- Posts with the same category or tag for further reading
- Pages or custom post-type content such as portfolios and testimonials
What’s so special about it?
Two things make a Query Loop block stand out: PHP-free solution and dynamic lists. You can have automatically updating lists on your homepage and other web pages without requiring any coding skills.
What’s the catch?
A Query Loop block has limitations when it comes to filtering options and appearance customizations. In appearance, you can only change color and typography for now. For filtering, you can only filter by a category, tag, author or keyword.
On the other hand, plugins are available that combine dynamic content display with the advanced features that WordPress 5.8 is missing.
How To Use the Query Loop Block
Here’s a step-by-step tutorial on using the Query Loop block on your website.
1. Adding the Query Loop Block
To use the Query Loop block, add the block on the page or post you want the dynamic list to appear. You can do so in one of two ways:
- Click the Add block button (+) and select the Query Loop block
- Type “/query loop” and hit enter in a new paragraph block
2. Configuring the Block
Once you’ve inserted the Query Loop block, configure the block to display the posts according to your specifications. You can do so by:
1. Choosing a Pattern
Once you’ve added the block to the post or page, you’ll see layout options for how you want the dynamic list to be displayed.
You can choose to view these layout options in a carousel or a grid format.
2. Inserting a Blank
Alternatively, you can work on a blank. You can do so by clicking on Start blank after inserting a Query Loop block. There are four variations you can choose from:
- Title & Date
- Title & Excerpt
- Title, Date, & Excerpt
- Image, Date, & Title
Each query loop block comprises multiple nested blocks, such as the Post Title block and Post Excerpt block. While customizing the appearance and layout is allowed, editing the nested blocks’ content is not possible.
3. Editing the Block
To edit the Query Loop block, click on the block, and a sidebar will appear. Customize the block by choosing the content you want to display or changing the appearance of the block.
Final Thoughts: Introducing WordPress 5.8’s Query Loop Block
The much-anticipated release of WordPress 5.8 has gotten fans buzzing about features such as the template editor and block-based widgets, which support WordPress’ move to Full Site Editing.
A layout block to look forward to is the Query Loop block that empowers you to display a list of posts without the need for code. Use the Query Loop block to display recent posts, portfolio images and testimonial pages on your homepage.
Although the Query Loop block has limited function, it shows a lot of potential in the near future coupled with Full Site Editing.
Visit Bluehost for the latest WordPress news.