Group Mods

  • Profile picture of @mercime
  • Profile picture of r-a-y
  • Profile picture of Hugo

Being re-directed to your Profile Page after login (10 posts)

Started 2 years, 2 months ago by: richard1987

  • Hi everyone,

    Just wondering if someone could please help me?

    On my Buddypress home page I have a login box (Username & Password). When the user clicks on login they have been logged in but they are unaware they are as they haven’t been redirected anywhere or no message has appeared.

    I was just wondering if someone could let me know how to redirect them to their profile page.

    Many Thanks

  • Anyone? Please :(

  • Profile picture of @mercime @mercime said 2 years, 2 months ago:

    http://wordpress.org/extend/plugins/bp-redirect-to-profile/

  • Profile picture of Famous Famous said 11 months, 2 weeks ago:

    I am really trying to understand this one, however, I cannot get it. All logins should redirect to the user profile, because that is why a user uses your site in the first place. They care about their information, not the websites general data. I have seen many posts about this, but why does BuddyPress think it’s not the case that a user should redirect to their info?

    Is there a way to code this, without getting into BuddyPress and later regretting it. I don’t want to use anymore plugins.

    Thanks for any enlightenment on this topic, and any help.

  • Profile picture of laconic laconic said 11 months, 2 weeks ago:

    > but why does BuddyPress think it’s not the case that a user should redirect to their info?

    That’s just the way it works. By default, the BuddyPress front page is not the user’s profile page.

    > Is there a way to code this, without getting into BuddyPress and later regretting it. I don’t want to use anymore plugins.

    You can either edit/create bp-custom.php in the plugins directory or use a plugin that someone has created like bp-profile-as-homepage. If you look at the code for this plugin (one short php file), it is very simple. It taps into a wordpress hook to add a check to see if the user is logged in and if so whether the current page is the front page. If it is, then it redirects to the user’s profile page. That seems to be what you want.

  • Profile picture of Mikey3D Mikey3D said 11 months, 2 weeks ago:

    You should let the user decide what they want to go not other way around.

    /plugins/bp-custom.php

    //=Redirect to User's Profile Page after Login
    function rt_login_redirect($redirect_to, $set_for, $user){
    	$redirect_to = bp_core_get_user_domain($user->id);
    	return $redirect_to;
    }
    add_filter('login_redirect', 'rt_login_redirect', 20, 3);
  • Profile picture of Famous Famous said 11 months, 2 weeks ago:

    Thanks for the answers. @Mikey3D, I used the code as you directed and it worked great.
    You said that I should let the user decide where to go and not the other way around. However, it’s not me that has decided that, rather it is the majority of social sites that directed users to their profile. Although, I must say that what you said is true also; a user should specify where they want to go although I haven’t seen that in practice. Great idea though.

    @laconic you said that’s just the way it works, but shouldn’t we question why it works that way. I hope no one gets me wrong–I really want BuddyPress to work, however someone on the internet commented that there is no successful BuddyPress site. Which may not be true, but it gets you thinking–how many BP sites are actually successful? I would think by now at this stage in the development that there would be quite a few. Does anyone know of any? I found this link to successful BP sites. To those who contribute to BP, thanks I really do appreciate BP.

  • Profile picture of valuser valuser said 11 months, 2 weeks ago:

    have a look at http://blogs.ubc.ca/

    certainly living proof that bp is an extremely useful platform.

  • Profile picture of Famous Famous said 11 months, 2 weeks ago:

    Really nice site @valuser thanks for sharing.

  • Profile picture of laconic laconic said 11 months, 1 week ago:

    @Famous I wasn’t trying to squelch your questioning the way it works but this is a How-To and Troubleshooting thread. So, I thought I would nudge us back to the question at hand. Glad you got things working the way you want. I, too, redirect for the same reason.

    Here is a site with 3,000+ members: http://www.h-mag.com/.