Customizing the BuddyPress blog loop

Currently the bp_has_blogs() loop does not allow an exclude param to remove certain blogs from the listing. By default all public blogs are listed. You can try a simple hack (but the pagination will be off) http://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/excluding-certain-blogs-from-bp_has_blogs-function-for-12/

Or you can filter on bp_has_blogs and loop over the array and unset (+ recount) prior to being displayed in the theme. While not ideal, pagination would be correct.

pseudo code for a filter: (though untested as i do run ms+bp setup – have a look at the source code file bp-blogs/bp-blogs-templatetags.php and the class BP_Blogs_Template for further info)

function my_remove_blog_from_loop( $b, $blogs ) {

foreach ( $blogs->the_blogs as $key => $blog ) {

    if ( $blog->blog_id == SOME_BLOG_ID_HERE ) {

        unset( $blogs->the_blogs[$key] );

        $blogs->blog_count = $blogs->blog_count-1;
        $blogs->total_blog_count = $blogs->total_blog_count-1;
        $blogs->pag_num = $blogs->pag_num -1;
    }
}

/* Renumber the array keys to account for missing items */
$blogs_new = array_values( $blogs->blogs );
$blogs->blogs = $blogs_new;

return $blogs;
}
add_action('bp_has_blogs','my_remove_blog_from_loop', 10, 2 );

replace SOME_BLOG_ID_HERE which whatever numerical blog_id