WordPress tip: Display informations about your multisite install

November 23, 2011 at 5:50 pm

Are you using the powerful “Multisite” WordPress feature? If yes, you may find useful to be able to display some information about your blog network: Network name, number of blogs and users… Here’s a ready to use function for your blog network.

To display information about your network, simply paste the following piece of code where you want the info to be shown, for example in your theme footer.

<?php if( is_multisite() ): ?>

   The <a href="<?php echo esc_url( get_site_option( 'siteurl' ) ); ?>"><?php echo esc_html( get_site_option( 'site_name' ) ); ?> network</a> currently powers <strong><?php echo get_blog_count(); ?></strong> websites and <strong><?php echo get_user_count(); ?></strong> users.

<?php endif; ?>

Once you saved the file, your blog network name as well as the user/blogs count will be displayed.

Thanks to Kevin Leary for the cool tip!