The MU forums have moved to WordPress.org

Main blog login->redirect to user blog (2 posts)

  1. carnold
    Member
    Posted 15 years ago #

    Using 2.6.1 and i want to redirect users to their blog. So you login at the main blog, http://mytimewithgod.net, and first check to see if the user has a blog, if not send them to the signup page. If they do, redirect them to there blog. How can i achieve this?
    I have searched the threads here and while there are posts about this, they don't seem to work, at least for me.
    http://mu.wordpress.org/forums/topic.php?id=7857
    http://mu.wordpress.org/forums/topic.php?id=6400
    Can anyone please help?

  2. nitsujri
    Member
    Posted 15 years ago #

    From your second link, you have the solution, but without seeing the entire function I can't tell if it works. Basically at the moment, it seems as if your $user_login isn't being filled.

    I think this will help you a lot:

    <?php global $user_ID, $user_login, $current_user, $user_identity;
    echo $user_ID . '<br />';
    echo $user_identity . '<br />';
    echo get_current_user_id() . '<br />';
    echo "HERE" . '<br />';
    print_r($current_user) . '<br />';?>

    the print_r on the $current_user is really a lot of info, but somewhere in there you can find what you're looking for. The main thing is, at the point of re-direction, are you entering into the function properly? Most likely not because $user_login isn't being fulfilled. You might be missing:

    global $user_login;

    Justin

About this Topic

  • Started 15 years ago by carnold
  • Latest reply from nitsujri