WordPress.org

Ready to get started?Download WordPress

Forums

Auto forward to different page if user is logged in (1 post)

  1. HorrorUK
    Member
    Posted 1 year ago #

    I have a home page which gives an explanation of the site, but I don't want my users hassled by it if they are already logged in.

    Is there a way to automatically take users to a different page if they go to the home page, if they are logged in?

    I found this code, and placed it into my functions.php file, but it didn't work:

    add_action( 'init', 'redirect_users' );
    
    function redirect_users() {
        if( is_user_logged_in() && is_front_page() ) {
            wp_redirect( 'http://dev.indie-film.tv/activity/' );
            exit;
        }
    }

    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.