Documentation

Query Loop Block

The Query Loop block allows you to query and display WordPress posts, pages, or custom post types in your email templates. Use it to create dynamic content like blog post summaries, recent posts, or custom post type listings.

Adding a Query Loop Block

  1. While editing your email template, click theย “+”ย button to add a new block
  2. Search forย “Query Loop”ย or find it in theย “Theme”ย category
  3. Click to insert the block
  4. Add a Post Template block inside to define how posts are displayed

Query Settings

Post Type

Select which post type to query:

  • Posts: WordPress blog posts
  • Pages: WordPress pages
  • Custom Post Types: Any registered custom post types

Number of Posts

  • Posts Per Page: Set how many posts to display
  • Offset: Skip a number of posts before starting

Order

  • Order By: Sort posts by date, title, author, etc.
  • Order: Ascending or descending order

Filters

  • Author: Filter by specific author
  • Search: Filter by search term
  • Categories/Tags: Filter by taxonomy terms
  • Exclude: Exclude specific posts
  • Sticky Posts: Include or exclude sticky posts

Adding Post Templates

  1. Click inside the Query Loop block
  2. Add aย Post Templateย block
  3. Inside the Post Template, add post information blocks:
    • Post Title
    • Post Date
    • Post Excerpt
    • Post Featured Image
    • Other custom blocks

Post Template Structure

A typical Post Template includes:

  1. Post Titleย – Title of the post (often as a heading)
  2. Post Dateย – Publication date
  3. Post Excerptย – Summary or excerpt
  4. Post Featured Imageย – Featured image (optional)
  5. Link to Postย – Make titles or content clickable

Best Practices

  1. Relevant Content: Query posts that are relevant to your email recipients
  2. Limit Results: Don’t display too many posts (3-5 is usually sufficient)
  3. Clear Layout: Design Post Templates for easy scanning
  4. Recent Content: Often useful to show recent posts
  5. Link to Full Content: Include links to full posts

Examples

Example 1: Recent Blog Posts

Query Settings:

  • Post Type: Posts
  • Posts Per Page: 3
  • Order By: Date
  • Order: Descending

Template: Title + Date + Excerpt + “Read More” link

Query Settings:

  • Post Type: Pages
  • Posts Per Page: 5
  • Filter by: Specific category or tag

Template: Title + Featured Image + Excerpt

Troubleshooting

Posts Not Displaying

  • Verify posts exist that match your query criteria
  • Check that the Post Template block is added inside Query Loop
  • Ensure post types are properly registered
  • Verify query parameters are correct

Wrong Posts Showing

  • Review query settings (post type, filters, order)
  • Check that filters are correctly configured
  • Verify post status (published posts only)

Template Not Rendering

  • Ensure Post Template block is properly nested inside Query Loop
  • Check that post blocks are inside the Post Template
  • Verify posts match query criteria

Additional resources

Use the links below for more information and guidance on adding blocks. Keep in mind that these articles are general information related to the WordPress Editor and building with blocks. Email Customizer does not utilize all blocks or functionality due to the limited capabilities of emails.

WordPress Editor