WordPress.org

Ready to get started?Download WordPress

Forums

Redirecting to page after login (2 posts)

  1. izevg
    Member
    Posted 1 year ago #

    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 =(

  2. izevg
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic