Created
October 18, 2023 07:02
-
-
Save raftaar1191/a6e0c4df605c68aadab48bb9789f2945 to your computer and use it in GitHub Desktop.
How can I limit the activity feed to show 10 posts, then the load more appears?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function limit_activities_displayed( $retval ) { | |
$isMob = is_numeric(strpos(strtolower($_SERVER["HTTP_USER_AGENT"]), "mobile")); | |
if ($isMob) { | |
$retval['per_page'] = 15; | |
} | |
else { | |
$retval['per_page'] = 5; | |
} | |
return $retval; | |
} | |
add_filter( 'bp_after_has_activities_parse_args', 'limit_activities_displayed' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment