This topic has 3 replies, 2 voices, and was last updated 5 years by Kieran_SQ.

  • Author
  • #203191
     Vanessa
    Participant

    Buddypress defaults to showing 20 items in the activity feed when it is loaded.

    How can I change this default? I’d like to make it smaller.

     

    thx

    #203201
     Kieran_SQ
    Moderator

    Hi,

    For the main activity feed please use the below snippet on a new line at the end of the KLEO Child theme’s functions.php file – you can do this via WP Admin > Appearance > Editor > KLEO Child > Functions.php or via your hosts file browser.

    COPY CODE
    function limit_main_activity( $loop ) {
     
        $loop['per_page'] = 5;
        
        return $loop;
    }
    add_filter( 'bp_after_has_activities_parse_args', 'limit_main_activity' );

    You can also limit the individual members activity feed with the below snippet. Add this as per the instructions above

    COPY CODE
    function limit_members_feed( $loop ) {
     
        // only fetch the last five entries if we're on a user's activity page
        if ( bp_is_user_activity() ) {
            $loop['per_page'] = 5;
        }
     
        return $loop;
    }
    add_filter( 'bp_after_has_activities_parse_args', 'limit_members_feed' );

    In each instance change the number 5 to suit your needs.

    Thanks,

    Kieran

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.

    #203224
     Vanessa
    Participant

    Thank you it worked beautifully!

    #203225
     Kieran_SQ
    Moderator

    Hi,

    You’re welcome, happy to help. If you have any other questions please feel free to open a new ticket and we’ll be happy to assist.

    All the best,

    Kieran

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.

Viewing 4 posts - 1 through 4 (of 4 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?