[wp-edu] Plugin to group posts across a subset of sites?

Benjamin Mueller benjaminrmueller at gmail.com
Fri Sep 28 15:39:30 UTC 2012


WordPress 3.5 is actually overhauling the switch_to_blog() function (
http://core.trac.wordpress.org/ticket/21434) to fix some of those
performance issues so using it shouldn't be an issue but as mentioned this
could be slow if the multisite instance is large.

http://wordpress.org/news/2012/09/wordpress-3-5-beta-1/

On Fri, Sep 28, 2012 at 7:42 AM, Martha Burtis (mburtis) <mburtis at umw.edu>wrote:

> I'd recommend using the Sitewide Tags plugin (
> http://wordpress.org/extend/plugins/wordpress-mu-sitewide-tags/) to
> create a Tags blog. This will, essentially, repost every public post in one
> place, maintaining information about the original author and permalink.
> Then you can grab a feed of the tag/category from the Tags blog. We use
> this at UMW to aggregate posts from around our entire multisite
> installation that use a particular course tag/category.
>
> Beware of the switch_to_blog function -- it's all but deprecated and can
> cause performance issues.
>
> HTH,
> Martha
>
>
>
> On Sep 28, 2012, at 8:50 AM, Jonathan Cox wrote:
>
> Check out http://codex.wordpress.org/Function_Reference/switch_to_blogand
> http://codex.wordpress.org/Class_Reference/WP_Query#Tag_Parameters
>
> I'd do something like
>
> foreach ( $blog_ids as $blog ) :
>    switch_to_blog( $blog );
>    $the_query = new WP_Query( 'tag=whatever-tag' );
>    while ( $the_query->have_posts() ) :
>        $the_query->the_post();
>        sprintf( '<h1><a href="%s">%s</a></h1>', get_permalink(),
> get_the_title() );
> // more the_loop stuff here if you want
>    endwhile;
> endforeach;
>
> The initial blog would need to be restored after the foreach block, but I
> can't say offhand if restore_current_blog() will restore it or the
> penultimate blog.
>
> It obviously becomes less efficient the more blogs you switch to and the
> more posts you pull.
>
> Jonathan Cox
> VCU Webmaster
> Technology Services
> (804) 827-0067
>
> On Sep 27, 2012, at 10:18 AM, Grogan, David wrote:
>
> Hello all,
>
>
> Does anyone have a solution for this use case?
>
>
> Given a subset of sites in our multi-site instance of WordPress, list the
> posts across those sites that have been specific tag or category.
>
>
> Thanks,
>
>
> David
>
>
> --------------------------------------------------------------
>
> David Grogan
>
> Senior Solutions Specialist
>
> Educational & Scholarly Technology Services (ESTS)
>
> University Information Technology (UIT) Tufts University
>
> 108 Bromfield Rd
>
> Somerville, MA  02144
>
>
> Phone: 617.627.2859
>
> Fax: 617.627.3082
>
>
> http://uit.tufts.edu/at/
>
> http://sites.tufts.edu/davidgrogan
>
>
>
>
>
> _______________________________________________
>
> wp-edu mailing list
>
> wp-edu at lists.automattic.com
>
> http://lists.automattic.com/mailman/listinfo/wp-edu
>
>
> _______________________________________________
> wp-edu mailing list
> wp-edu at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-edu
>
>
>
> _______________________________________________
> wp-edu mailing list
> wp-edu at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-edu
>
>


-- 


Thanks,
Benjamin Robert Mueller
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.automattic.com/pipermail/wp-edu/attachments/20120928/b2137d1e/attachment.htm>


More information about the wp-edu mailing list