New
PeoplePress is here. Community building for WordPress, reimagined. Fast, modern, and built for the communities you've always wanted to run.
See it live

BuddyDev

Search

How to limit the activity stream in total?

  • Participant
    Level: Initiated
    Posts: 18
    Josh on #55081

    I am using the max parameter to limit the activiy stream but when I put in 5 for example it shows 5 items, then when I click “load more” further 5 items and further 5 items and so on.

    How to limit the items at all? Show ONLY the newest 5 items and no “load more”.

    I know that I might achieve that deleting the “if ( bp_activity_has_more_items() ) : ?>” at the activity template but is there a better way to do what I want?

  • Keymaster
    (BuddyDev Team)
    Posts: 25513
    Brajesh Singh on #55097

    Please try setting per_page and max both. If that does not work, something is changing you max.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 18
    Josh on #55229

    Thanks Brajesh, I will test.

  • Participant
    Level: Initiated
    Posts: 18
    Josh on #55273

    I tried this but its not working???

    <?php if ( bp_has_activities( bp_ajax_querystring( 'activity' ).'&max=5&per_page=5' ) ) : ?>

  • Participant
    Level: Initiated
    Posts: 18
    Josh on #55274

    &per_page=5 has the same effect as &max=5. It shows 5 items and the load more button. I deleted all plugins except buddypress and bp classic and use the latest twentysomething theme. So two args for the same result. Does that make sense?

  • Keymaster
    (BuddyDev Team)
    Posts: 25513
    Brajesh Singh on #55275

    Hi Josh,
    You are right. The max does not work. Load more is still shown. The only way around it would be to filter on bp_activity_has_more_items and disable it.

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved