[request] Recent Featured Blog Posts Feed

Is there any way to hack the Recent Global Posts Feed plugin so it only pulls posts from specified blogs, instead of all blogs? If not, please consider this a request for a plugin that will create an RSS feed for posts from specific blogs.

We have a number of "Featured Blogs" and would like to have a feed that pulls posts from only those blogs. We would then use that feed in the new Multisite Dashboard Feed Widget so all members would see the latest posts from these blogs in their dashboard. Neat, huh?

Extra Credit: Creating a new Recent Featured Blog Posts Widget (similar to Recent Global Posts Widget) would be just dandy too!

I'm hoping it might be easy enough to add a config section to the Global Posts Feed plugin where desired site IDs could be listed. Thanks for the consideration!

  • Mason
    • DEV MAN’s Sidekick

    Hiya jcjnr,

    For now, it'd be a manual hack. Not a bad feature request though, so I'll notify a couple devs to see what there take on it is. The recent-global-posts-feed.php file already has a few configuration options in it.

    Anyway, for this option you'll have to edit the SQL query on line 58. Just add the following into the phrase, I've copied the bits around it so that you can see how it'll fit:
    site_posts WHERE blog_id IN (2, 5, 7, 9) AND site_id = %d

    Change the values 2, 5, 7, 9 to the Blog IDs you actually want to query.

    Hope that helps!

  • jcnjr
    • HummingBird

    FYI: After updating Post Indexer and Recent Global Posts Feed plugins, the steps outlined above and in my tutorial will no longer work, and the Featured Posts feed will be broken. It will still validate, but no longer fetch any new posts.

    Oh well, such goes progress...it was fun while it lasted!

    I know this is beyond the scope of support here, but if anyone is interested in giving it a go, I'd love any pointers for creating a new Featured Posts feed, based on the new v.3.0+ plugin code.

    I scanned the code, and it's totally different. But I wonder if what I'm trying to do may be as simple as adding some sort of site_id variables to the array at line 42 of recent-global-posts-feed.php:
    $network_query_posts = network_query_posts( array( 'post_type' => $posttype, 'posts_per_page' => $number ));

    Or, could it be done by hacking line 43 of global-posts-feed.php:

    if($this->db->blogid == 1) {
    // Only add the feed for the main site
    add_action('init', array(&$this, 'initialise_global_posts_feed') );
    }

    Or... does all this just make it obvious that the task is clearly beyond me? :slight_smile:

    Regardless, consider this a renewed feature request to add options for limiting sites fetched by the Recent Global Posts Feed.

    Thanks, and cheers!

  • Jack Kitterhing
    • Code Norris

    Hi there @jcnjr,

    Hope you're well today! :slight_smile:

    As you've seen in the latest version we use network_query which is basically WP_Query, http://codex.wordpress.org/Class_Reference/WP_Query

    You then might want to write a custom query using network query and switch to blog http://codex.wordpress.org/Function_Reference/switch_to_blog

    It also certainly is a great feature request as well! :slight_smile:

    Kind Regards
    Jack.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.