The MU forums have moved to WordPress.org

Listing the number of blogs? (4 posts)

  1. roguestar
    Member
    Posted 16 years ago #

    i saw on someones MU that the had a bit that said "we currently host 1234 blogs" which i thought looked rather good, how can i do that on my MU homepage? Whats the call for this function?

    thanks

  2. Klark0
    Member
    Posted 16 years ago #

    Something like

    We currently host <?php
    $stats = get_sitestats();
    $tmp_blog_count = number_format ($stats[ 'blogs' ] );
    print "".$tmp_blog_count." blogs";
    ;?>

    http://codex.wordpress.org/WPMU_Functions

  3. roguestar
    Member
    Posted 16 years ago #

    wow, that was quick. it works great. thank you very much.

  4. eagano
    Member
    Posted 16 years ago #

    If you only want the blog count, and not other site stats, you can just use this:

    <?php
    $sites = get_blog_count();
    ?>

    This function is called by get_sitestats(), along with some others. It stores (caches) the value as a site option and recalculates it if the current stored value is older than one hour.

    http://codex.wordpress.org/WPMU_Functions/get_blog_count

About this Topic

  • Started 16 years ago by roguestar
  • Latest reply from eagano