Query loop: How to create a page with a list of posts?

In WordPress, you can create a page with entries. A great example is a “blog” page with all the posts sorted by date. How to create such a website? It’s easy, use the query loop.

There is a Query Loop block in the Gutenberg editor that allows you to display the entries or pages where you are inserting that block. By using specific functions in this block, you can customize the page in terms of design, layout and structure.

How to use the query loop?

Click the insertion element (+) and select the Query Loop block from the blocks menu. It consists of two components:

Query Loop

Query loop

Defines which entries, how many there will be, and in what order they will be displayed, e.g. the last 6 blog entries.

Settings on the top bar:

Query loop display parameters in the top bar
Query loop display parameters in the top bar
Query loop display parameters in the top bar
query loop
List view
Query loop
Grid view

Settings on the sidebar:

  • Post Type (Post, Page, Product, Support Article, Document)
  • Columns
  • Order by (Order of displaying entries)
  • Sticky posts (Blog posts can be “stickied”, a feature that places them at the top of the front page of posts, keeping it there until new sticky posts are published)
  • Filters (displaying entries only from a selected category, tag, given author or containing specific keywords)

Post Template

Post Template defines which elements of the entry will be displayed and how they will be arranged, e.g. Post Featured Image, Post Date, Post Title, Post Excerpt). You can freely change their order.

Post Template
Post Template

Query Pagination

If you want to display more entries, consider adding another Query Pagination block. Thanks to this, the entries will be divided into subpages.

Query pagination
Query pagination

This is what the pagination looks like on the website:

Need help?

Thank you!

We will answer to your message as soon as possible

Need help? support-icon