Shortcode Display Posts

There are three types of parameters:

  • Query parameters determine which posts are listed. You can query based on category, author, date, and more.
  • Display parameters determine how the posts are listed. You can include the post title, thumbnail, excerpt, and more.
  • Markup parameters allow you to change the underlying HTML markup, including CSS classes

Example: [display-posts post_type="page" include_excerpt="true" excerpt_more="Continue Reading" excerpt_more_link="true"]

Query Parameters

Specify the post author.
Default: empty
Example: [display-posts author="bill"]

Specify the author ID
Default: empty
Example: [display-posts author_id="1"]

Specify the category slug, or comma separated list of category slugs.
Default: empty
Example: [display-posts category="fishing,hiking"]

Specify the category ID
Default: empty
Example: [display-posts category_id="123"]

Specify a date to query for posts published that date.
Default: empty
Example: [display-posts date="2014-09-07"]

Specify which date column to use for all date queries.
Default: post_date
Example: [display-posts date="Yesterday" date_column="post_modified_date"]

Specify the comparison operator used for all date queries. 
Default: =
Example: [display-posts date="-1 year" date_compare=">"]

Specify the before argument for a date query.
Default: empty
Example: [display-posts date_query_before="2015-12-31" date_query_after="2015-01-01"]

Specify the after argument for a date query.
Default: empty
Example: [display-posts date_query_before="2015-12-31" date_query_after="2015-01-01"]

Specify the date column used for this query.
Default: post_date
Example: [display-posts date="Yesterday" date_query_column="post_modified_date"]

Specify the comparison operator used for this query.
Default: =
Example: [display-posts date="-1 year" date_query_compare=">"]

Specify one or more post IDs to exclude from query
Default: false
Example: [display-posts exclude="9, 11"]

Specify whether or not to exclude the current post from the query
Default: false
Example: [display-posts exclude_current="true" taxonomy="category" tax_term="current"]

True for posts with passwords; false for posts without passwords; null for all posts with and without passwords (default).
Example: [display-posts has_password="true"]

Specify a specific post ID (or multiple post IDs) to display.
Default: empty
Example: [display-posts id="9, 10"]

Specify whether or not to ignore sticky posts.
Default: false
Example: [display-posts ignore_sticky_posts="true"]

Specify a meta key, for meta queries or ordering.
Default: empty
Example: [display-posts meta_key="price" orderby="meta_value_num" order="ASC"]

Specify a meta value, for meta queries.
Default: empty
Example: [display-posts meta_key="color" meta_value="blue"]

The number of posts to pass over.
Default: 0
Example: [display-posts offset="3"]

Specify whether posts are ordered in descending order (DESC) or ascending order (ASC).
Default: DESC
Example: [display-posts order="ASC"]

Specify what the posts are ordered by.
Default: date
Options include: date, modified, rand, comment_count, menu_order, ID, author, title, name, type, meta_value, meta_value_num, post__in
Example: [display-posts orderby="title"]

Display the pages that are a child of a certain page. You can either specify an ID or ‘current’, which displays the children of the current page.
Default: empty
Example: [display-posts post_type="page" post_parent="8"]

post_parent__in Display the pages that are the child of a set of pages.
Default: empty
Example: [display-posts post_type="page" post_parent__in="10, 20"]

post_parent__not_in Exclude pages that have one of these parents.
Default: empty
Example: [display-posts post_type="page" post_parent__not_in="10,20"]

Show posts associated with a certain
Default: publish
Example: [display-posts post_status="publish, future"]

Specify which post type to use. You can use a default one (post or page), or a custom post type you’ve created.
Default: post
Example: [display-posts post_type="event"]

How many posts to display.
Default: 10
Example: [display-posts posts_per_page="5"]

Search for posts using a search query.
Default: empty
Example: [display-posts s="about"]

Display posts from a specific tag, or tags. You must use the tag slug(ex: example-tag), not the tag’s name (ex: Example Tag).
Default: empty
Example: [display-posts tag="tag1, tag2"]

taxonomy, tax_term, tax_include_children, and tax_operator
Use these parameters to do advanced taxonomy queries. Use ‘taxonomy’ for the taxonomy you’d like to query, ‘tax_term’ for the term slug (or terms) you’d like to include, and ‘operator’ to change how the query uses those terms (most likely this field will not be needed).
Default: ‘taxonomy’ = empty , ‘tax_term’ = empty , ‘tax_operator’ = ‘IN’
Example: [display-posts taxonomy="color" tax_term="blue, green"]

Specify the time, to be used in a date query. 
Default: empty
Example: [display-posts date="Yesterday" time="9:00am"]

Display Parameters

Include the post’s title.
Default: true
Example: [display-posts include_title="false" image_size="thumbnail"]

Specify an image size for displaying the featured image, if the post has one. The image_size can be set to thumbnail, medium, large (all controlled from Settings > Media), or a custom image size. See Image Alignment
Default: empty
Example: [display-posts image_size="thumbnail"]

Specify whether or not to include the post’s author name.
Default: false
Example: [display-posts include_author="true"]

Specify whether or not to include the full post content. Note that [display-posts] will be stripped out of the content to prevent infinite loops
Default: false
Example: [display-posts include_content="true"]

Include the post’s date after the post title. The default format is (7/30/12), but this can be customized using the ‘date_format’ parameter.
Default: empty
Example: [display-posts include_date="true"]

Specify the date format used when ‘include_date’ or ‘include_date_modified’ is true. See Formatting Date and Time on the Codex for more information.
Default: ‘(n/j/Y)’
Example: [display-posts include_date="true" date_format="F j, Y"]
Example: [display-posts include_date="true" date_format="relative"]

Include the post’s last modified date after the post title. The default format is (7/30/12), but this can be customized using the ‘date_format’ parameter. Note that this can only be used if ‘include_date’ is not true.
Default: empty
Example: [display-posts include_date_modified="true"]

Include the post’s excerpt after the title (and date if provided).
Default: empty
Example: [display-posts include_excerpt="true"]

Include a dash before the excerpt.
Default: true
Example: [display-posts include_excerpt=”true” include_excerpt_dash=”false”]

Specify the number of words used in an excerpt.
Default: empty (set by your theme)
Example: [display-posts include_excerpt="true" excerpt_length="20"]

Specify the more text that appears after the excerpt.
Default: empty (set by your theme)
Example: [display-posts include_excerpt="true" excerpt_more="..."]

Specify whether or not to link the excerpt_more text to the post.
Default: false
Example: [display-posts include_excerpt="true" excerpt_more="Continue Reading" excerpt_more_link="true"]

Include a “-” before the excerpt
Default: true
Example: [display-posts include_excerpt="true" include_excerpt_dash="false"]

Post’s title is link to post page.
Default: true
Example: [display-posts include_title="true" include_link="false"]

Specify ‘true’ to display the categories the current post is in. Specify a taxonomy slug (e.g., ‘post_tag’) to list a different taxonomy.
Default: empty
Example: [display-posts category_display="true"]

If using category_display, specify the label that appears before the list of categories.
Default: “Posted in: “
Example: [display-posts category_display="true" category_label="Categorized as: "]

Specify a message to display if no posts are found.
Default: empty
Example: [display-posts category="on-sale" no_posts_message="Sorry, no items are currently on sale"]

Give the list of posts a title heading.
Default: empty
Example: [display-posts title="Recent Posts"]

Markup Parameters

Specify the class name used for the post content.
Default: content
Example: [display-posts include_content="true" content_class="dps-listing-content"]

What type of HTML should be used to display the listings. It can be an unordered list (ul), ordered list (ol), or divs (div) which you can then style yourself.
Default: ul
Example: [display-posts wrapper="ol"]

Class applied to the wrapper tag for custom css formatting for this instance.
Default: display-posts-listing
Example: [display-posts wrapper="div" wrapper_class="my-grid-layout"]

Specify an unique ID to be used on the wrapper of this listing.
Default: empty
Example: [display-posts category="cars" wrapper_id="cars-listing"]