Support » Fixing WordPress » Redirecting to page after login

  • Hi.

    I need to know, how I can redirect users after login from main (not admin) page to other? I think, I must get current user state, then I must write something like

    if (is_user_logged_in() && <strong>UNKNOWN_FUNC()</strong>)
    {
        global $current_user;
        get_currentuserinfo();
        $user_info = get_userdata($current_user->ID);
        if ( $user_info->user_level == 0 )
        {
            wp_redirect('<strong>MyPage</strong>', 301);;
        }
    }

    but how?
    Please, help =(

Viewing 1 replies (of 1 total)
  • I lost to say what I have a login widget in sidebar, and user can login from any page. I have to do redirect after login from any to one.

Viewing 1 replies (of 1 total)
  • The topic ‘Redirecting to page after login’ is closed to new replies.