For loop type post
, page
, and custom post type, here are the query parameters and fields.
author
- Include by author ID, login name, or "current"category
- Include by category ID, slug, or "current"child_terms
- Set "true" to include child terms for hierarchical taxonomiescustom_date_field
- Filter by given custom date field. See filtering the loop for information on when this attribute should be used.<Loop type=event custom_date_field=event_date_time custom_date_field_format="Y-m-d H:i:s" custom_date_field_compare=before custom_date_field_value=current>
custom_date_field_compare
- Compare using one of: "equal" (default), "not", "before", "before_inclusive", "after", "after_inclusive"custom_date_field_format
- For custom date field query, specify the date format of the field value - Default is "Ymd"; For date-time field, set "Y-m-d H:i:s". If it's a timestamp, use "timestamp". For custom field plugins other than ACF, you may need to use a different format.custom_date_field_type
- For custom date field query, one of: date (default), time, datetime, numbercustom_date_field_value
- Filter by given custom date field value, or "current"custom_field
- Filter by given custom field. Use with "custom_field_compare" and "custom_field_value" attributes. See filtering the loop for information on when this attribute should be used.<Loop type=post custom_field=news_type custom_field_compare=not custom_field_value=exclusive>
custom_field_2
- See attribute "custom_field"custom_field_3
- See attribute "custom_field"custom_field_compare
- Compare using one of: "equal" (default), "not", "before", "before_inclusive", "after", "after_inclusive"custom_field_compare_2
- See attribute "custom_field_compare"custom_field_compare_3
- See attribute "custom_field_compare"custom_field_type
- For custom field query, one of: string (default), number, date, time, datetimecustom_field_type_2
- See attribute "custom_field_type"custom_field_type_3
- See attribute "custom_field_type"custom_field_value
- Filter by given custom field valuecustom_field_value_2
- See attribute "custom_field_value"custom_field_value_3
- See attribute "custom_field_value"exclude
- Exclude by ID or nameexclude_author
- Exclude by author ID, login name, or "current"exclude_category
- Exclude by category ID, slug, or "current"exclude_parent
- Exclude by parent ID or nameexclude_tag
- Exclude by tag ID, slug, or "current"id
- Get posts by ID(s)ignore_sticky_posts
- Ignore sticky postsTRUE
include
- Include by ID or nameinclude_children
- Include childrenname
- Name/slugorder
- Order: asc (ascending) or desc (descending)asc
orderby
- Order by one of: id, author, title, name, type, date, modified, random, comment_count, relevance, menutitle
orderby_field
- Order by custom fieldorderby_field_number
- Order by custom field whose value is a numberpage
- Page number1
paged
- Posts per page-1
parent
- Include by parent ID or namepublish_compare
- Publish date comparison - One of: "before", "before_inclusive", "after", "after_inclusive"publish_date
- Filter by publish date in Y-M-D format, "today", "X days ago" and other values compatible with strtotime() - Optionally use "publish_compare" attribute<Loop type=post publish_compare="after" publish_date="2 weeks ago">
publish_day
- Filter by given publish day of the month, from 1 to 31, or "current"publish_month
- Filter by given publish month, from 1 to 12, or "current"publish_week
- Filter by given publish week, from 1 to 54, or "current" - Note: the "publish_compare" attribute is not supported for this fieldpublish_year
- Filter by given publish year, or "current"search
- Search by given keyword - Prepending a keyword with a hyphen "-" will exclude posts matching it<Loop type=course search="{Url query=keywords}">
status
- Post status: publish (default), pending, draft, future, private, trashpublish
tag
- Include by tag ID, slug, or "current"taxonomy
- Include by taxonomy ID, slug, or "current" for taxonomy archivetaxonomy_2
- See attribute "taxonomy"taxonomy_3
- See attribute "taxonomy"taxonomy_compare
- One of "in" (default), "not", "and", "exists", and "not exists"<Loop type=agency taxonomy=expertise taxonomy_compare=and terms=marketing,creative>
taxonomy_compare_2
- See attribute "taxonomy_compare"taxonomy_compare_3
- See attribute "taxonomy_compare"taxonomy_relation
- When using more than one "taxonomy" queries, can specify "and" or "or"<Loop type=event taxonomy=category taxonomy_compare=exists terms=seminar taxonomy_relation=and taxonomy_2=category taxonomy_compare_2=not terms_2=workshop,training>
terms
- Include by taxonomy term ID, slug, or "current"<Loop type=post taxonomy=category terms=opinions>
terms_2
- See attribute "terms"terms_3
- See attribute "terms"type
- Post type(s)post
all
- Show all custom fields (for development purposes)ancestors
- Ancestor posts from lowest to highest level; Set reverse=true to go from top-level downarchive_author
- On an author archive page, looping through this field creates a user loop of the current authorarchive_post_type
- On a post type archive page, looping through this field creates a post loop of the current post typearchive_term
- On a taxonomy archive page, looping through this field creates a taxonomy term loop of the current termauthor
- Authorauthor_*
- Author's user field where the asterisk can be replaced with any field from the user loop such as author_avatar_url
.children
- Childrenchildren_ids
- Children IDscontent
- Contentedit_url
- Edit URLexcerpt
- Excerptid
- IDimage
- Featured imageimage_*
- Featured image field where the asterisk can be replaced with any field from the attachment loop such as image_url
.menu_order
- Menu ordermodify_date
- Modify datename
- name/slugparent
- Parentparent_*
- Parent field where the asterisk can be replaced with any field from the post loop such as parent_title
.
parent_ids
- All parent IDs from current to toppost_class
- Post classespublish_date
- Publish datestatus
- Statustitle
- Titleurl
- URLFor post excerpts, the attribute auto=true
can be used to optionally generate an excerpt from post content for posts that don't already have content in their excerpt field.
<Field excerpt auto=true />
Attributes to customize:
words
Maximum number of words - default 55
more
Text to display after content is trimmed - default: […]