Learn Computer Academy

WP_Query Args Builder

Build a secondary, custom query visually — get the real WP_Query PHP back, with the loop wrapped around it.

The Loop lesson

This builds a secondary query (new WP_Query) for things like a related-posts block or a custom grid — distinct from the main loop the paired lesson covers, which uses the global have_posts()/the_post().

Presets

Post Selection

Post Status
Which statuses to include. Defaults to "publish" only if just that one is checked.

Pagination & Order

Category & Tag

Taxonomy Query

For a custom taxonomy — filter by one or more terms, with AND/OR/NOT IN logic.

Author

Search

Meta Query

Filter by custom field (post meta) values.

Date Query

Other Options

Performance Flags

WordPress caches these by default — only disable them if you have a specific reason (e.g. a one-off query you never repeat).

Generated PHP

$query = new WP_Query( array(
    'post_type'      => 'post',
    'posts_per_page' => 6,
    'orderby'        => 'date',
    'order'          => 'DESC',
) );

if ( $query->have_posts() ) :
    while ( $query->have_posts() ) : $query->the_post();
        // your markup here
        the_title();
    endwhile;
    wp_reset_postdata();
endif;