Hi @takinglife2themax,
activities are very much coupled with ajax. And js is intolerant with a lot of little things such as css or code errors.
If you copied the whole bp-legacy/buddypress/ into your theme, it is like you had 2 bp install, or at least a core and two templateted BP. Even if child has priority in the template hierarchy, JS is not able to handle this such easily (more on BP Dev blog). So it is better to load only the needed legacy file to the child.
Can you show the code you use to filter the activity (pastebin or github) ?
Hi @danbp,
Thanks for helping me out with this. I’m not so worried about the css issue right now, I’m going to get that squared away after I can get this content filter to work. Do you think that I have to add my modified bp-legacy files to my parent theme as well?
The only file that I’ve changed in the bp-legacy/buddypress/activity
folder is activity-loop.php, and I only changed line 3 to the following:
<?php if ( bp_has_activities( bp_ajax_querystring( 'activity' ).'&object=status' ) ) : ?>
Do you think that I have to add my modified bp-legacy files to my parent theme as well?
For sure. If you don’t, the next BP update will overide this folder. Golden rule: never touch/modify any of the original plugin files.
Any change you make is to do in the child-theme, including the legacy files you added to it.
Theme Compatibility & Template Files
You could also revert back, and try this function ( add it to child-theme’s functions.php)
function bpfr_filtering_activity( $retval ) {
// activities to filter on, comma separated
$retval['object'] = 'status';
return $retval;
}
add_filter( 'bp_before_has_activities_parse_args', 'bpfr_filtering_activity' );
Read here for more details.
Thanks a lot @danbp!
The function you provided was EXACTLY what I needed. I appreciate the post you provided with additional info as well. Extremely helpful stuff.
After I added the function I realized that my activity stream was not showing anything. Then, I figured out that the BuddyPress Activity Plus Plugin doesn’t register status updates. So, once I deactivated it, everything was working perfectly.
Thanks again, you are a huge help!
Alright, I have an update.
It turns out that BuddyPress Activity Plus was not to blame after all. For some reason, when I use $retval['object'] = 'status';
it only shows activity updates that I’ve just submitted. Once I refresh the page, the stream is empty again.
So I changed the function you provided to try to get around this, and to be conditional to the home page of my eX-Stream site only:
function bpfr_filtering_activity( $retval ) {
global $blog_id;
// activities to filter on, comma separated
if ( $blog_id == 13 && is_front_page() ) {
$retval['action'] = 'activity_update';
}
return $retval;
}
add_filter( 'bp_after_has_activities_parse_args', 'bpfr_filtering_activity' );
OK, well done ! 😉 I mark this topic as resoled and close it.