do_action( 'bp_before_activity_loop' ); ?>
100000,
'offset' => 0,
'category' => '',
'category_name' => 'freedom-friend-news',
'order' => 'desc',
'orderby' => 'date',
'include' => '',
'exclude' => '',
'meta_key' => '',
'meta_value' => '',
'post_type' => 'post',
'post_mime_type' => '',
'post_parent' => '',
'author' => '',
'author_name' => '',
'post_status' => 'publish',
'suppress_filters' => true
);
$news_articles = get_posts( $args );
$counter = 1;
while( bp_activities() ): bp_the_activity();
if ( 0 === $counter % 5 ) {
// Do something here.
}
bp_get_template_part( 'activity/entry' );
$current_user = wp_get_current_user();
if( $current_user->user_login == 'tommy' ):
$count++;
$news_iteration = $count / 7)-1;
// Loop through news articles as long as there are articles.
if( $count % 7 == 0 && !empty( $news_articles[$news_iteration] )):
echo 'News Article';
echo 'Iteration: '.$news_iteration;
echo $news_articles[$news_iteration]->post_title;
echo $news_articles[$news_iteration]->post_excerpt;
endif;
endif;
$counter++
endwhile; ?>
-