With the upcoming release of GenerateBlocks 2.0, I’ve been testing out the new Query Block introduced in the beta versions. This block is quite different from the Query Loop Block in previous versions, so I wanted to break it down and explain how it works to help you understand which elements to edit for different purposes.
Inserting the Query Block
I have a test site running GenerateBlocks 2.0 Beta 9.
- Add a Container Block.
- Insert an Inner Container (optional, for structure).
- Insert the new Query Block.
- The block is now called “Query”, not “Query Loop.”
- Do not confuse it with WordPress’ Core Query Loop Block.
- Choose a Layout (e.g., Title, Date, and Excerpt).
Understanding the Three Main Parts of the Query Block
Once the Query Block is inserted, you’ll see three nested blocks inside it:
- Query Block (Outer Container)
- Looper Block (Controls the Layout)
- Loop Item (Holds Individual Content)
1. The Query Block (Outer Container)
- The Query Block tells WordPress what to display.
- You can set it to query posts, pages, or other content types.
- You can also style this container as a whole (e.g., adding a background color that applies to everything inside it).
Example:
If you add a light gray background, the entire query section—including the Looper, Pagination, and No Results sections—inherits that color.
2. The Looper Block (Controls the Layout)
- This dictates the layout of your query loop.
- Determines how many columns appear (e.g., 2-column, 3-column, etc.).
- To adjust settings, click the Looper Block, then go to the Settings Panel.
Options:
- Grid Layout Presets (1, 2, 3+ columns).
- Row and Column Gaps (e.g., 40px spacing between posts).
- Background Color (only applies to the Looper, not individual posts).
Example:
If you set a dark gray background here, it applies only to the Looper section, separate from the outer Query Block background.
3. The Loop Item (Holds Individual Content)
- The Loop Item contains the actual post content (e.g., title, excerpt, image).
- You can style it individually (padding, alignment, background color).
Example:
- If you set a background color in the Loop Item, it only applies to each individual post.
- If you adjust padding, it affects only the content inside each Loop Item.
Additional Features: Pagination & No Results
- These elements come pre-loaded with some Query Block templates.
- You can remove or re-add them using the Query Block settings panel.
To Re-Add Pagination & No Results
- Click on the Query Block (top level).
- Go to Block Settings.
- Click “Add Pagination” or “Add No Results”.
Recap: How the Query Block is Structured
Think of it as three nested containers:
- Query Block (Outer Container) → Controls what to display.
- Looper Block → Controls layout & number of columns.
- Loop Item → Controls individual post styling.
Each block has its own settings, so be sure to edit the right one depending on what you need to adjust.