Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

BUDDYPRESS: Stop overriding default parameters passed to loop WordPress

  • REFUNDED

How do I stop BP from overriding default parameters passed to the template loop?

For example, on the Activity page, let's say you want BP to "forget" the user's last viewed parameter (like "My Forums" or "@user Mentions") and go right back to All Members or My Friends every time you reload the page.

I tried deleting the contents of ajax.php and global.js, and the overriding behavior still happens. How do I stop BP from doing this?

Answers (1)

2010-04-05

Buzu B answers:

I don't think I really understand what it is you are trying to accomplish here, but if what you want to do is to show a content instead of another, you might want to try redirecting the user, you can use simple and crude techniques like javascript redirection, or a more "sophisticated" approach using htaccess, but again, I'm not really sure what it is you are trying to do.


3sixty comments:

You are not familiar with buddypress you should start here

http://buddypress.org

buddypress saves cookies that indicate which activity stream tab you last selected. When you return to that page, the user is forced back to that tab, rather than the default tab. What I am trying to do is ovErride that behavor so the default tab is always selected.


3sixty comments:

oops, reply output got buffered. Above reply should read: "IF you are not familiar..."

moderator, please edit if possible (no edit option available to me - my reply look inadventently rude!)


3sixty comments:

Solution:

The function that handles this is bp_init_activity(). If you comment the call to this function out (around line 15 of global.js), it should stop the cookie from overriding your default settings.


Buzu B comments:

Nice!, I'm glad you found the solution. Now I just want to point out the location of global.js in case anybody has the same question but doesn't know where to find the file. The file is not in the plugin files but in the bp-default theme files. You need to use a buddypress compatible theme when using budypress, and buddypress comes with a default theme which you need to put in your themes directory. The file global.js is located in that wp-default theme, inside the _inc folder, so if you have already moved bp-default theme to your themes directory on wp, the file should be located on

wp-installation-folder/wp-content/themes/bp-default/_inc/default.js

Now, 3sixty, I guess there is no reason for the question to be open, I guess you could close it. Again, I'm glad you were able to find the answer on your own, good luck!


3sixty comments:

hmm, I don't see a way to close the question... if there is a way to do it, the link is not obvious (or else I am oblivious)


Buzu B comments:

Humm.. I wouldn't know. I have never asked. But I guess, in that case just let the time run off.