Title: query-loop – Make WordPress Core

---

#  Tag Archives: query-loop

 [  ](https://profiles.wordpress.org/annezazu/) [annezazu](https://profiles.wordpress.org/annezazu/)
1:12 am _on_ September 23, 2024     
Tags: [core-editor-improvement ( 35 )](https://make.wordpress.org/core/tag/core-editor-improvement/),
query-loop   

# 󠀁[Core Editor Improvement: Simplified Query Loop block with smarter defaults & intuitive settings](https://make.wordpress.org/core/2024/09/23/core-editor-improvement-simplified-query-loop-block-with-smarter-defaults-intuitive-settings/)󠁿

_These “CoreCore Core is the set of software required to run WordPress. The Core
Development Team builds WordPress. Editor Improvement…” posts (labeled with the _
[_#core-editor-improvement_](https://make.wordpress.org/core/tag/core-editor-improvement/)_
tagtag A directory in Subversion. WordPress uses tags to store a single snapshot
of a version (3.6, 3.6.1, etc.), the common convention of tags in version control
systems. (Not to be confused with post tags.)) are a series dedicated to highlighting
various new features, improvements, and more from Core Editor related projects. _

In the spirit of Matt’s “simple things should be easy and intuitive, and complex
things possible”, the Query LoopLoop The Loop is PHP code used by WordPress to display
posts. Using The Loop, WordPress processes each post to be displayed on the current
page, and formats it according to how it matches specified criteria within The Loop
tags. Any HTML or PHP code in the Loop will be processed on each post. [https://codex.wordpress.org/The_Loop](https://codex.wordpress.org/The_Loop)
blockBlock Block is the abstract term used to describe units of markup that, composed
together, form the content or layout of a webpage using the WordPress editor. The
idea combines concepts of what in the past may have achieved with shortcodes, custom
HTML, and embed discovery into a single consistent API and user experience. has 
been refreshed with a focus on ensuring the most intuitive default state possible
out of the box and increased clarity when trying to achieve anything more complex
with custom queries. All of what’s shared below is slated for inclusion in the upcoming
[WordPress 6.7 release on November 12th, 2024](https://make.wordpress.org/core/2024/09/03/roadmap-to-6-7/).

### **Strong defaults**

With recent updates, you no longer need to manually enable “Inherit query from template.”
The Query Loop block now automatically inherits the query by default, ensuring expected
posts are displayed both in the editor and on the front end. This change simplifies
the process for most users, who typically just want to see their posts appear without
complications. It also minimizes the likelihood of confusion, such as when a Query
Loop block is added but posts don’t show up. Now, whenever you add a Query Loop 
block—whether starting from scratch or using a pattern—your posts will display immediately.
This includes when adding a Query loop block to single post or page where the settings
will automatically be configured to work in that context. Additionally, the Post
List variation has been removed from the Inserter, as its default settings often
caused posts to not display, leading to a confusing user experience.

 * [Query Loop: Change default query loop variations](https://github.com/WordPress/gutenberg/pull/63353#top).
 * [Set Query Loop to have the inherit value by default](https://github.com/WordPress/gutenberg/pull/63362).
 * [Query Loop Block: remove Posts List variation](https://github.com/WordPress/gutenberg/pull/63404#top).
 * [Query Loop: Default to querying posts when on singular content](https://github.com/WordPress/gutenberg/pull/65067#top).

### **Added clarity**

To make this complex block more user-friendly and predictable, the settings have
been simplified. Now, there’s a toggle to choose between using the default options
or creating a custom query. If you select a custom query, another toggle lets you
choose between posts or pages, with the usual filtering options. For custom post
types, this section becomes a dropdown for easier selection. In response to feedback
about scattered settings for the Query Loop block, options for Posts Per Page, Offset,
and Max Pages to Show have been moved to the Settings panel. This change makes the
settings sidebarSidebar A sidebar in WordPress is referred to a widget-ready area
used by WordPress themes to display information that is not a part of the main content.
It is not always a vertical column on the side. It can be a horizontal rectangle
below or above the content area, footer, header, or any where in the theme. the 
central place to configure the Query Loop block fully.

 * [Update Inherited Query Loop value from Template Settings changes](https://github.com/WordPress/gutenberg/pull/63358#top).
 * [Query Loop block: Convert the post content type setting to a ToggleGroupControl if there are few items](https://github.com/WordPress/gutenberg/pull/63375#top).
 * [Make Query Loop settings more intuitive with a ToggleGroup and simplified help text](https://github.com/WordPress/gutenberg/pull/63739).
 * [Move Posts Per Page, Offset, and Pages controls from the block toolbar into Inspector Controls](https://github.com/WordPress/gutenberg/pull/58207#top).

### **Refined details**

The details matter, and these refinements are no exception: a preview now appears
when selecting the Query Loop block, and the “Add a new post” prompt now reflects
the specific type of content you’re querying. The help text for sticky posts has
been updated to clarify that sticky posts will always appear first. Additionally,
the enhanced pagination setting has been moved to the Advanced section with a new
label for better clarity.

 * [Add example for Query Loop block and Posts list](https://github.com/WordPress/gutenberg/pull/63286#top).
 * [Replace “Add new post” link text with more meaningful Label (v2)](https://github.com/WordPress/gutenberg/pull/62277#top).
 * [Update help text for sticky control in Query loop](https://github.com/WordPress/gutenberg/pull/63999).
 * [Update: Rephrase “Force page reload” and move to Advanced](https://github.com/WordPress/gutenberg/pull/65081#top).

**Post format support**

To help take steps towards post formats in Block themes, the Query Loop block has
a [new parameter called “format”](https://github.com/WordPress/gutenberg/pull/64167)
that allows you to filterFilter Filters are one of the two types of Hooks [https://codex.wordpress.org/Plugin_API/Hooks](https://codex.wordpress.org/Plugin_API/Hooks).
They provide a way for functions to modify data of other functions. They are the
counterpart to Actions. Unlike Actions, filters are meant to work in an isolated
manner, and should never have side effects such as affecting global variables and
output. the content shown by post format, in the same way you’d filter by any other
option. This additional filter can be combined with others so you can create custom
queries for something as nuanced as posts by a specific author across two categories
and with a certain post format. 

[⌊Query Loop block filter settings showing Categories, Tags, and Author with the"
Formats" option highlighted for emphasis. ⌉⌊Query Loop block filter settings showing
Categories, Tags, and Author with the "Formats" option highlighted for emphasis.
 ⌉[

[#core-editor-improvement](https://make.wordpress.org/core/tag/core-editor-improvement/),
[#query-loop](https://make.wordpress.org/core/tag/query-loop/)