Skip to content

WP_Query String Generator (Advanced Query Builder)

In this article

    Total’s grid and card elements include query settings that cover most needs, such as choosing a post type, including or excluding terms, querying by custom fields, and setting the order.

    For anything beyond that, the elements also have an Advanced Query that accepts a WP_Query as a URL-style string. This lets you filter by multiple taxonomies, custom fields, dates, and more without writing PHP.

    Use the builder below to generate the string, then paste it into the element’s Query → Query Parameters String field.

    Query

    Include terms

    Exclude terms

    Posts with any of these terms are removed from the results.

    Custom fields

    Values accept today, current_post, current_term, current_author and current_user.

    Advanced Query

    Paste into the element's Query → Advanced Query field. Advanced Query replaces the element's other query settings.

    Dynamic Values

    The following values are replaced at runtime, which is useful for related posts, author archives, and date-based queries:

    • current_post – the ID of the post being viewed
    • current_term – the ID of the term being viewed on archives
    • current_author – the ID of the author being viewed
    • current_user – the ID of the logged-in user
    • today – today’s date in Ymd format

    Other Arguments

    The builder covers the most common arguments. Any other WP_Query argument can be added to the generated string by hand.

    Related Articles
    Back To Top