Hi there
I am currently looking for a simple and easy way to display the total number of posts and comments in my WPMU installation. I want it to be displayed in my home.php template for the mainsite.
Something like this: "This site currently contains 1642 blogs, 21355 posts and 50406 comments".
Is this possible?
-Jacob
I have a cron script running every hour and checking the blogs that were updated, then updating two extra columns i've created in wp_blogs for post and comment count cache. Then you just need a "select sum()". I don't think there's an easyway, unless maybe in recent version MU keeps a cache of total count in the site options/meta. Not sure.
There's a call to spew the number of blogs and users.. lemme dig it up.
bogs and users is easy though, it's only a count in the main tables. posts and comments are the tough part.
We used to have the blog and user count displayed on the admin page. You can see usage of those functions here:
http://trac.mu.wordpress.org/changeset/784#file5
I don't know right off of a built in function on the other one.