How To: Remove “All Members” Activity Feed
-
After much research through many old threads, using the combination of a few, I figured out how to remove the “All Members” view of the Activity feed.
I originally tried a solution posted by paulhastings0 on the page https://buddypress.org/support/topic/change-the-default-activity-tab/
However, as a member in that thread posted a few comments later, this only changes the default selection of the tab, it does not in fact change the feed that is loaded. So the tab said “My Friends” (or whatever tab you set as selected), but the feed that loaded was still the “All Members” feed.
The second option I found (which I can’t find again to link to while writing this) only removed the “All Members” tab option, but simply left the tab as a blank space, while still loading the “All Members” feed.
If you combine the two solutions however, it works like a charm!
So, here’s the solution:
You should be working in the BP Child theme.
1) Copy the index.php file from ../wp-content/themes/boss/buddypress/activity
2) Paste the index.php into your ../wp-content/themes/boss-child/buddypress/activity directory (it doesn’t exist, so you’ll have to create it)
3) Use the first solution by paulhastings0 in the old thread to change which tab is default selected by removingclass="selected"
from the<li class="selected" id="activity-all"><a href="<?php bp_activity_directory_permalink(); ?>" title="<?php esc_attr_e( 'The public activity for everyone on this site.', 'boss' ); ?>"><?php printf( __( 'All Members <span>%s</span>', 'boss' ), bp_get_total_member_count() ); ?></a></li>
line (on line 24) and addclass="selected"
to the new tab you want selected (I chose the “My Friends” tab, so for me it was<li id="activity-friends"><a href="<?php echo bp_loggedin_user_domain() . bp_get_activity_slug() . '/' . bp_get_friends_slug() . '/'; ?>" title="<?php esc_attr_e( 'The activity of my friends only.', 'boss' ); ?>"><?php printf( __( 'My Friends <span>%s</span>', 'boss' ), bp_get_total_friend_count( bp_loggedin_user_id() ) ); ?></a></li>
on line 34.
4) Now, delete the<li id="activity-all"><a href="<?php bp_activity_directory_permalink(); ?>" title="<?php esc_attr_e( 'The public activity for everyone on this site.', 'boss' ); ?>"><?php printf( __( 'All Members <span>%s</span>', 'boss' ), bp_get_total_member_count() ); ?></a></li>
code from line 24.Hope this saves someone from hours of searching like I did!
- You must be logged in to reply to this topic.