Query Loops

Query Loops

Query loops ask WordPress for content, then repeat your HTML once for each result.

Basic Shape#

Start with query:posts when you want normal blog posts:

phpresources/views/front-page.php
{{ query:posts }}  <h2>{{ title }}</h2>{{ /query:posts }}

The opening tag asks WordPress for posts. The closing tag ends the loop. Everything between them repeats for each result.