• How can I display a list of the X most recent posts from any of the sites within a multisite network on only the main blog’s homepage? I’d also like to be able to show a list of the X most recently updated blogs by blog name. I had asked a similar question a few weeks ago and Andrea gave me some code to list the names of updated blogs (http://wordpress.org/support/topic/multi-user-home-page-aggregation?replies=4) however when I add this code to my template it shows up on every blog and not just the main blog’s home page. I thought the old version of wpmu had a special template for the main blog home page (home.php?) but when I tried to add this to my template the home.php file shows up for the main blog and every other subblog. Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • No, the home.php was not specific to mu. It’s a template file is all. And yes, if all blogs are using the same theme and you add that file, all blogs will get it.

    If you want something on just the main blog, you can use that code as a widget.

    Thread Starter b-rad

    (@b-rad)

    Thanks Andrea. Is there a tutorial on how to create a basic widget to use the code you had given me to display the names of recently updated blogs? Since my widgets are set to display in the sidebar, can a widget be setup to display the recently updated blog list in the main content area of the home page or will it end up in a sidebar with my other widgets? I guess I need a tag to tell me if the page being viewed is the “main” blog’s home page.

    Can you tell me how to also display recent posts for all blogs in a multisite setup? Thanks.

    yep – http://wpmututorials.com/plugins/build-your-own-widget/

    , can a widget be setup to display the recently updated blog list in the main content area of the home page or will it end up in a sidebar with my other widgets?

    you’d need a widget area in the spot where you want that widget to show. they don’t have to be sidebars.

    I guess I need a tag to tell me if the page being viewed is the “main” blog’s home page.

    there isn’t one.

    Alternatively, you can make a second copy of your theme. use one with the home.php and all the stuff you want on the main site;s home page. use the other one for the remaining blogs.

    Can you tell me how to also display recent posts for all blogs in a multisite setup?

    Depends. 🙂 In a list or full posts, cuz there’s two different answers. 🙂

    Doesn’t this work?

    <?php
    global $blog_id;
    if ($blog_id == 1) {
       // display this content
    }
    ?>

    Alternately you could create a page template and apply it only to the page you have designated as your front page (assuming you are not using the blog page [index.php] for your front page). Of course anyone using the theme could then apply this template to any of their pages, as Andrea_r indicated, but it would not be automatic.

    Copy the file you are using, hopefully page.php, and rename it myhomepage.php (name it anything BUT home.php). Put this near the top (after the theme info):
    <?php /* Template Name: My Home Page */ ?> (name it anything you like — this is what will appear in admin in the template pulldown menu in the right column.

    Now you can do what ever you want in this file and it will only affect pages that have opted to use it as a template.

    Yeah that works too.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Showing New Posts and Updated Blogs Only on Home Page’ is closed to new replies.