Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to change default activity stream tab?

  • @yassin-bey

    Participant

    Hello,

    I want to change the default activity stream tab from “All members” to “My groups”. How do I do this? I just can’t find the solution.

    Please help me. Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • @rosyteddy

    Participant

    @yassin-bey

    Participant

    Great! thank you, found the solution in https://buddypress.org/support/topic/change-the-default-activity-tab/.

    Here’s the solution by @paulhastings0 and it also works with the Buddypress Follow plugin:

    1. Make sure that you’re working on a child theme of the BP Default theme.
    2. Copy/paste the contents of bp-default/activity/index.php into your child theme’s activity/index.php folder
    3. Find the line <li class=”selected” id=”activity-all”> and delete class=”selected”
    4. Scroll down a few lines further to <li id=”activity-friends”> and insert class=”selected” just after id=”activity-friends”

    🙂

    @maddish

    Participant

    Did this solution really work for you?
    I’m surprised because in my case it did not.
    As in this thread other users say, on one hand the browser remember the last selected tab, and on the other, the loop displayed in the stream is still the activity-all.

    I found another solution based on cookies.

    There is a cookie named ‘bp-activity-scope’ that is used to query the activity stream posts and that must be set to ‘groups’ in order to display only the posts that belongs to groups.

    This is the script that worked for me, in which ‘My Groups’ is the default tab:

    var jq = jQuery;
    jq(document).ready( function() {
    
    	filter = jq('#activity-filter-select select').val();
    		jq.removeCookie('bp-activity-scope', {
    		path: '/'
    		});
    //change 'groups' with the cookie for the tab you want to be the default one
    // favorites , friends, etc
    	jq.cookie( 'bp-activity-scope', 'groups');
    	scope = jq.cookie('bp-activity-scope');
    	bp_activity_request(scope, filter);
    
    } );

    I wrote a post in which I explain step by step how to implement it, and also how to avoid that the activity-all tab is switched to selected when the user focus on the wwhat’s new textarea:

    http://inauditas.com/change-default-activity-stream-tab-buddypress/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to change default activity stream tab?’ is closed to new replies.
Skip to toolbar