The MU forums have moved to WordPress.org

Number of posts and comments in WPMU installation (5 posts)

  1. boetter
    Member
    Posted 17 years ago #

    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

  2. quenting
    Member
    Posted 17 years ago #

    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.

  3. andrea_r
    Moderator
    Posted 17 years ago #

    There's a call to spew the number of blogs and users.. lemme dig it up.

  4. quenting
    Member
    Posted 17 years ago #

    bogs and users is easy though, it's only a count in the main tables. posts and comments are the tough part.

  5. drmike
    Member
    Posted 17 years ago #

    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.

About this Topic