[posts]
Displays posts. Check WP_Query page for more info on params.
Aliases: [wp_query]
.
Attributes
- sep
- (optional) Separator.
- Default:
<br>
- Default:
- max_posts
- (optional) Max posts to return number.
- Default:
10
- Default:
- output_format
- (optional) Output format. Replaced values:
%title%
,%link%
.- Default:
%title%
- Default:
- post_type
- (optional) Post type. Can be custom type, e.g.:
product
.- Default:
post
- Default:
- post_status
- (optional) Post status, e.g.:
publish
.- Default:
any
- Default:
- orderby
- (optional) Order by parameter, e.g.:
date
.- Default:
title
- Default:
- order
- (optional) Order (
ASC
orDESC
).- Default:
ASC
- Default:
Examples
Example #1
Display five recently published products as list:
[posts max_posts="5" post_type="product" post_status="publish" orderby="date" order="desc" before="<h3>Recent Products</h3><ul><li>" sep="</li><li>" after="</li></ul>" output_format="<a href='%link%'>%title%</a>"]
Example #2
Display twenty recently published posts:
[posts max_posts="20" post_type="post" post_status="publish" orderby="date" order="desc" before="<h3>Recent Posts</h3>"]
Output #2
Recent Posts
[total_posts]
[total_users]
[is_user_logged_in]
[user_location]
[user_login]
[total_categories]
[total_taxonomy]
[is_user_role]
[font_awesome]
[copyright]
[dashicon]
[wc_current_currency_code]
[wc_current_currency_symbol]
[total_tags]
[login_url]
[youtube]
[google_map]
[wc_product_id]
[wc_product_price_html]
[progress]
No comments yet.