I would like to “omit” certain blogs from the regular BuddyPress blog loop. Either by blog ID or blog Name is fine. Has anyone had success doing this?
Leave a Reply
You must be logged in to post a comment.
I would like to “omit” certain blogs from the regular BuddyPress blog loop. Either by blog ID or blog Name is fine. Has anyone had success doing this?
You must be logged in to post a comment.
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)
replace SOME_BLOG_ID_HERE which whatever numerical blog_id
Similar method works to exclude members: