Display four buddypress activies [closed]

Hi I am trying to create a buddypress theme and I kind of figured out how to do it but I need to create an activity loop that displays only 4 activities.Now if I wanted to do this in a normal wordpress loop I would I have done this:

query_posts(array(
              'posts_per_page'=>'3',
              'post-type'=>'post',
              'paged' => get_query_var('paged')
             )           
        );

I have tryed this in the activity looop but this does not work.This is the loop I created for the activity stream:

<?php if ( bp_has_activities() ) : ?>  
                        <ul id="activity-stream" class="activity-list item-list">  
                        <?php while ( bp_activities() ) : bp_the_activity(); ?>  

                            <li class="<?php bp_activity_css_class() ?>" id="activity-<?php bp_activity_id() ?>">  

                                <div class="activity-avatar">  
                                    <a href="https://wordpress.stackexchange.com/questions/64111/<?php bp_activity_user_link() ?>">  
                                        <?php bp_activity_avatar( 'type=full&width=40&height=40' ) ?>  
                                    </a>  
                                </div>  

                                <div class="activity-content">  

                                    <div class="activity-header">  
                                        <?php bp_activity_action() ?>  
                                    </div>  

                                    <?php if ( bp_get_activity_content_body() ) : ?>  
                                        <div class="activity-inner">  
                                            <?php bp_activity_content_body() ?>  
                                        </div>  
                                    <?php endif; ?>  

                                    <?php do_action( 'bp_activity_entry_content' ) ?>  

                                </div>  
                            </li>  

                        <?php endwhile; ?>  

                        </ul>  

                     <?php else : ?>  
                        <div id="message" class="info">  
                            <p><?php _e( 'Sorry, there was no activity found. Please try a different filter.', 'buddypress' ) ?></p>  
                        </div>  
                     <?php endif; ?>  
                </div>

What do I need to modify in order to display only the lates 4 activities?

1 Answer
1

See the codex:
http://codex.buddypress.org/developer-docs/custom-buddypress-loops/the-activity-stream-loop/

You probably want this:

<?php if ( bp_has_activities( 'max=4') ) : ?>

Leave a Comment