获取所有groups\\u ID后,我通过执行以下操作获取所有activities\\u ID:
<?php
global $bp,$wpdb;
$groups_ids = implode(\', \', $groups_ids);
$sql = "SELECT id FROM {$bp->activity->table_name} WHERE component = \'groups\' AND item_id IN ({$groups_ids})";
$activity_ids = $wpdb->get_results( $sql);
$a_id = array();
foreach ($activity_ids as $activity_id )
{
$a_id[] = $activity_id->id;
}
?>
然后,通过执行以下操作,我只获得一个具有指定组的活动循环:
$params = array(\'per_page\' => \'6\', \'in\' => $a_id);
if ( bp_has_activities($params) ) :
endif;