[total_posts]

Displays total number of posts in your site.

Attributes

post_type
(optional) Post type. Can be custom type, e.g.: product.
Default: post
post_status
(optional) Post status, e.g.: publish.
Default: any
categories
(optional) Comma-separated list of category IDs. Use current for the current category ID. Leave empty to count all posts.
Default: None

Examples

Example #1

Display total number of published posts in your WordPress blog:

[total_posts before="This blog has " after=" published posts." post_status="publish"]

Output #1

This blog has 45 published posts.

Example #2

Display total number of published products in your WooCommerce based shop:

[total_posts before="This shop has " after=" products." post_type="product" post_status="publish"]

Output #2

0

Example #3

Display total number of completed orders in your WooCommerce based shop:

[total_posts before="So far we've completed <strong>" after="</strong> orders." post_type="shop_order" post_status="wc-completed" on_zero="No orders yet."]

Output #3

No orders yet.
No comments yet.

Leave a Reply