I'm using a post aggregator (Donncha) so that I can display a list of posts on the homepage that will include every blog on the site. It is working great so far.
Now I've been tasked with dividing the bloggers into three different groups: Public, VIP and Staff. We'd like to display three separate lists (in chronological order) for each group of blogs.
I wasn't sure if there was an easy way to perform this query, but I had another idea...
Before the posts are displayed I call the 100 most recent posts and divide them up using a loop.
query_posts('showposts=100'); ?>
while(have_posts()) {
the_post();
$blog_details = get_active_blog_for_user(get_the_author_ID());
if(in_array($blog_details->blog_id, $second_sphere_id_list))
{
$second_sphere_posts[] = $post;
}
else
{
$first_sphere_posts[] = $post;
}
}
My question is... after I've built these separate arrays of $post how do I load them so that I can use WP functions such as the_title() and the_excerpt()? I tried borrowing setup_postdata() from the_post() function but it didn't work...
foreach ($second_sphere_posts as $current_post)
{
setup_postdata($current_post);
the_title();
}
Is this impossible?