Recent Global Posts Widget: howto exclude the root blog?

How would I go about excluding the root blog on a site from the Recent Global Posts Widget?

Thank you.

  • drmike
    • DEV MAN’s Mascot

    I don;t have a clue as I don;t have ra-sites.php. That’s probably a question for Andrea and Ron on their site.

    Without that though, on a normal install, I would just compare blog_id out of the wp_site_posts table, which is where the site wide posts are stored and, if blog_id is ‘1’, do a return or whatever to get past that post.

  • Andrew
    • Champion of Loops

    Yeh, we don’t have access to the ra-sites plugin so this is probably a question for them. Basically you’ll have to get the blogid of the main blog for each site and then exclude it by editing the query EX:

    $query = "SELECT * FROM " . $wpdb->base_prefix . "site_posts WHERE blog_id != ‘1’ ORDER BY post_published_stamp DESC LIMIT " . $options;

    Replace the ‘1’ with the blogid of the main blog for each site. As I mentioned though, I don’t have access to their plugin so I’m not 100% sure what’s the best way to get the blog id of the main blog for each site.

    Thanks,

    Andrew