WordPress.org

Ready to get started?Download WordPress

Forums

Code or plugin to redirect user to front page after login? (8 posts)

  1. raygene
    Member
    Posted 6 years ago #

    Hi,

    Is there a way to redirect the user to the front page after logging in instead of the profile (backend) page like all CMS do?

    Thanks,
    Gene

  2. whooami
    Member
    Posted 6 years ago #

    I do it, but I dont use a plugin -- I hacked the core.

  3. raygene
    Member
    Posted 6 years ago #

    Hi Who,

    Care to share the secret, irritates the heck out of my users to be directed to their profile then having to click on "Visit Site"...

    Thanks,
    Gene

  4. whooami
    Member
    Posted 6 years ago #

    what version of wp are you using?

  5. whooami
    Member
    Posted 6 years ago #

    if youre using 2.5 look inside wp-login.php:

    case 'login' :
    default:
    	if ( isset( $_REQUEST['redirect_to'] ) )
    		$redirect_to = $_REQUEST['redirect_to'];
    	else
    		$redirect_to = 'wp-admin/';

    thats the bits that does it.

  6. raygene
    Member
    Posted 6 years ago #

    Thanks,

    I'm using 2.5, so it would be the link below that I would have to change?

    else
    $redirect_to = 'wp-admin/';

    'wp-admin/' to 'BlogName/' ?

    Thanks,
    Gene

  7. raygene
    Member
    Posted 6 years ago #

    Thanks Woo, it works...

    I did 'wp-admin/' to '/BlogName' (forward slash before the blog name).

    Cheers,
    Gene

  8. raygene
    Member
    Posted 6 years ago #

    Works OK but now I have to find a way for when the registered user (subscriber) to go directly to his profile page when he clicks on the Site Admin link.

    Don't take me wrong, I really like WP but some basic features are lacking compared to some forum/CMS/blog systems I tested.

    Most software will either change the Site Admin link to Profile for basic membership or have separate links for Profile and one for Admin.

    Cheers,
    Gene

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.