BuddyDev

Search

[Resolved] Members profile – reducing the number of items in the activity count

  • Participant
    Level: Master
    Posts: 413
    Venutius on #5825

    Hi Brajesh,

    Last year you helped me create a members profile view that had the members profile settings displayed first and then the members activity.

    What we effectively did was to add the contents of activity.php to the end of the profile,php.

    This works fine, however I would like to limit the number of items displayed in the activty list to say 10 items. How would I do this please?

  • Participant
    Level: Master
    Posts: 413
    Venutius on #5826

    Actually thinking about it, it was the groups you helped me with, I think I made that change all by mtself, but either way I would appreciate your advice.

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2934
    Ravi on #5831

    Hi George,

    Thank you for posting here, Are you looking to limit group’s activity into members setting page?.

    Thank You,
    Ravi

  • Participant
    Level: Master
    Posts: 413
    Venutius on #5836

    I effect what I am looking to do is to reduce the number of activity items displayed when the user clicks on the profile/activity button.

  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #5880

    Hi George,
    Please put this code in your bp-custom.php

    
    function buddydev_limit_number_in_activities( $args ) {
    	
    	if ( bp_is_user_activity() ) {
    		$args['per_page'] = 5; //how many?
    	}
    
    	return $args;
    }
    add_filter( 'bp_after_has_activities_parse_args', 'buddydev_limit_number_in_activities' );
    

    Also, please change 5 to the number of activities you want to display.

    Hope that helps.

    Regards
    Brajesh

  • Participant
    Level: Master
    Posts: 413
    Venutius on #5886

    Thanks Brajesh, but unfortunately that did not work, I wrapped it in PHP tags and placed it in the wp-content/plugins directory am I doing something wrong?

  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #5890

    Do you have a bp-custom.php in your wp-content/plugins directory? If yes, Please put it there or you may put it in your functions.php

    Hope that helps.

  • Participant
    Level: Master
    Posts: 413
    Venutius on #5895

    Strangely, it worked in functions.php, not in bp-custom.php no idea, it threw up an error on line 2

You must be logged in to reply to this topic.

This topic is: resolved