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!';
Stunt snippets has published: