WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:

              '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="<?php bp_activity_user_link() ?>">  
                                        <?php bp_activity_avatar( 'type=full&width=40&height=40' ) ?>  

                                <div class="activity-content">  

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

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

                                    <?php do_action( 'bp_activity_entry_content' ) ?>  


                        <?php endwhile; ?>  


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

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

share|improve this question

closed as off-topic by Pieter Goosen, toscho Jul 2 '14 at 14:50

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

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') ) : ?>
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.