WordPress.org

Ready to get started?Download WordPress

Forums

Multi-User Home Page Aggregation (6 posts)

  1. b-rad
    Member
    Posted 4 years ago #

    Prior to WP3, the multi-user version of WordPress included a special home page that showed the latest posts from other blogs as well as newly created blogs. Having this functionality back without having to install various outdated plugins and widgets would be awesome.

  2. It was one line of code in the original home theme, and is still available here:

    http://trac.mu.wordpress.org/browser/trunk/wp-content/themes/home/home.php

    For those too lazy to click, this code:

    <?php
    	$blogs = get_last_updated();
    	if( is_array( $blogs ) ) {
    	        ?>
    	        <ul>
    	        <strong>Updated Blogs</strong>
    	        <?php foreach( $blogs as $details ) {
    	                ?><li><a href="http://<?php echo $details[ 'domain' ] . $details[ 'path' ] ?>"><?php echo get_blog_option( $details[ 'blog_id' ], 'blogname' ) ?></a></li><?php
    	        }
    	        ?>
    	        </ul>
    	        <?php
    	}
    	?>

    Paste that in a theme file somewhere.

    there are also plugin in the repo listed at the top of this page that will give latest posts AND are not outdated.

  3. b-rad
    Member
    Posted 4 years ago #

    Thanks!

  4. b-rad
    Member
    Posted 3 years ago #

    How can I use the above code only on the multisite home page and not each individual blog's home page? I looked at the WP conditional tags but I didn't see anything that would allow me to target that one main page. Thanks.

  5. sugbloggen
    Member
    Posted 3 years ago #

    @b-rad - If I understand your question correctly you just need to add that code in a themefile on the root site.

  6. dains
    Member
    Posted 3 years ago #

    Update, the trac link no longer works. Thank goodness Andrea posted the code for posterity!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags