Anyone? Sorry for bumping topic, but has been one week and no answer
This very same question was asked in another thread that I responded to yesterday, I’ll look for a link to it.
Quick search often comes up trumps
https://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/how-to-limit-activity-items-for-per-page/#post-81113
Hello @hlna, thanks for the answer, I had done a search before and found that thread, but I still have 2 problems:
1/ The functions.php hack does not work since I have my activity loop in several places, and in only one of them I need to filter the activity.
2/ The concatenating solution does not display anything at all…
Any other ideas?
Sorry for bumping again…there has to be someone that knows a way to do this??
@revolutionfrance Just wondering if this won’t work! Why don’t you just add the filter function directly into your theme file exactly where u want the filter to apply right before you call the
`<?php if ( bp_has_activities( bp_ajax_querystring( 'activity' )) ) >`
I mean something like this:
`
<?php
function my_query_filter_new ( $query_string ) {
$query_string .= ‘&per_page=10’;
return $query_string;
}
add_filter( ‘bp_ajax_querystring’, ‘my_query_filter_new’ );
if ( bp_has_activities( bp_ajax_querystring( ‘activity’ )) ) >
`
I haven’t tried this but I don’t see why it wouldn’t work.
I hope this helps.
I got this to work using the last bit of code shown above, however, it needs to be added without the smiley:
`<?php
function my_query_filter_new ( $query_string ) {
$query_string .= ‘&per_page=5’;
return $query_string;
}
add_filter( ‘bp_ajax_querystring’, ‘my_query_filter_new’ );
if ( bp_has_activities( bp_ajax_querystring( ‘activity’ )) ) ; ?>`
The problem I have, is that once this has been added, the ‘Load More’ link at the bottom doesn’t do anything.