The MU forums have moved to WordPress.org

Yet another Feed question... (7 posts)

  1. doodlebee
    Member
    Posted 15 years ago #

    Hey all - I've been searching for an answer to this for a couple of weeks now. I've found all kinds of threads on this forum, and tried all kinds of solutions and plugins mentioned here - as well as solutions I've found through google. However, all of the things I have tried have come *seriously* close - but no cigar.

    What I have is a WPMU installation that has a total of 5 blogs - first is the "master" and then 4 sub-blogs. These are all set up as subdirectories, not subdomains (if that matters).

    What I need is for the most recent post from each blog to appear on the master index page.

    Like I said, I've found *many* threads to this very effect, with many solutions - as well as some from Google. But here's the catch, I guess: I *need* it to remain the most recent post from each blog.

    What I mean is, the solutions I've tried do this *BUT* they don't keep with this idea. What happens is, if another blog post something at a more recent date, it overrides and pushes the older ones down as it updates - so two posts from the same blog could appear.

    For example, when I initially start it, it'll have:

    stuff from blog 1 - 7/10/2008
    stuff from blog 2 - 7/7/2008
    stuff from blog 3 - 7/6/2008
    stuff from blog 4 - 7/3/2008

    Now, say someone from Blog 3 comes along and posts a new entry - then the feed changes to look like so:

    stuff from blog 3 - 7/17/2008
    stuff from blog 1 - 7/10/2008
    stuff from blog 2 - 7/7/2008
    stuff from blog 3 - 7/6/2008

    But what I *want* to happen is this:

    stuff from blog 1 - 7/10/2008
    stuff from blog 2 - 7/7/2008
    stuff from blog 3 - 7/17/2008
    stuff from blog 4 - 7/3/2008

    Does that make sense?

    Like I said, I've tried all kinds of things to get this to work - but the existing solutions I've found seem to basically lump all the feeds into a single feed, and then draw from that. I want them to be kept separated.

    Would anyone know how to edit the existing solutions (this one, this one, and this one - to name a few I've tried), or know of some way I can "scrape" my feeds (and yes, they're all mine) to accomplish what I need to do?

    Thanks muchly for any point in the right direction :)

  2. dsader
    Member
    Posted 15 years ago #

    If it's just a handful of blogs, here's what I have done

    <?php $featured_blogs= array(2, 3, 4, 5); // any blog_id
    foreach($featured_blogs as $featured_blog) {
    switch_to_blog($featured_blog);
    query_posts($query_string.'posts_per_page=1'); //
    echo 'cut'n paste your favorite "the loop" from "if (have_posts()) : "
    to "endif;"';
    }
    restore_current_blog();
     ?>

    Wait a tic, this works fine on my WWPM1.5.1 install but does not return the correct links in my WPMU2.6rc1 install ( http://mu.wordpress.org/forums/topic.php?id=8900 )

  3. tdjcbe
    Member
    Posted 15 years ago #

    Either that or take the sitewide feed plugin, make a copy of it, modify it to only pull a single post form each blog instead of the (I believe) hundred it currently pulls, and use the feed from that.

    The "issue" with dsaders fix is that it gets made every time it's accessed. The sitewide feed plugin caches within the database (well it used to at least.) and that means less load.

    You'd have to decide which would work best for you. Some coding would be required with the sitewide as well since you'ld have to rename the functions as well.

  4. doodlebee
    Member
    Posted 15 years ago #

    Okay - thank you both for that - I appreciate it :)

  5. doodlebee
    Member
    Posted 15 years ago #

    Well, I tried both solutions, and neither of them did exactly what I wanted - I dunno, maybe I'm just being picky. (I do love the caching idea, so I tried harder on that one, to be honest.) But in the end, what has *definitely* worked out was the code I found here. Basically, I just set the posts to "1", and then repeated the code (changing the feed) for each one. Now they're in the order I want, and showing the most recent post. My index.php file in my theme is butt-ugly and massively huge, and it's not automated, but that's okay - it works.

    Thanks so much for your input though - I really do appreciate it!

  6. andrea_r
    Moderator
    Posted 15 years ago #

    Ooo, here's a thought. Set up a feedburner feed network for those blogs, and it will build *one* feed for them.

    And sue the same thing you did, except just once. :D

    But hey, glad you got it working.

  7. iamsgf
    Member
    Posted 15 years ago #

    i am still in the process of setting up my site and playing with feed, but take a look at megablogs.net on the front page i have 3 different feeds. do any of those do what you need? if so let me know and i will get you the code or tell you whatplugin i am using for it.

About this Topic

  • Started 15 years ago by doodlebee
  • Latest reply from iamsgf