Display the total number of posts

$numposts = $wpdb->get_var(“SELECT COUNT(*) FROM $wpdb->posts WHERE post_status = ‘publish'”);
if (0 < $numposts) $numposts = number_format($numposts);

Right now, the $numposts variable contains the total number of posts. You now just have to display it where you want:

<?php echo $numposts.’ has been published since January 12, 2008′; ?>


milo on "WordPress Hacks"