WordPress count posts

In: WordPress

September 18th, 2010.

If you would like to present number of posts on your WordPress blog – than you could use WP function called wp_count_posts(). And if you want to just count published posts, follow the snippet below:

echo 'So far - we have published: ' . wp_count_posts()->publish . ' posts!';

Example of count posts

Stunt snippets has published:

[count_posts] posts

Written by

Dejan is pragmatic software developer with Master's Degree in Computer Science. He is currently based in Belgrade (Serbia).