Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter pastoradeola

    (@pastoradeola)

    I was able to resolve the issue from Chad’s previous post using,

    add_filter( ‘wpmem_login_redirect’, ‘my_login_redirect’ );

    function my_login_redirect()
    {
    // return the url that the login should redirect to
    return ‘http://yourdomain.com/your-page’;
    }

    But now I want the link
    http://christembassyarlington.org/login/’
    always redirected to
    http://christembassyarlington.org/live-service/’
    when a member is already logged in.
    Thanks

    Plugin Author Chad Butler

    (@cbutlerjr)

    You could use a combination of is_page(‘login’) and is_user_logged_in. If both return true, redirect.

    if( is_page( 'login' ) && is_user_logged_in() ) {
      wp_redirect( 'http://christembassyarlington.org/live-service/' );
      exit();
    }

    You could work that in in a number of ways; the easiest probably being directly in the page template. But with redirection being part of that process, you should probably put it into a hook that occurs before headers are sent, such as ‘init’

    Thread Starter pastoradeola

    (@pastoradeola)

    Wow…..Thanks man. Worked like a charm. I appreciate it.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Login Page Redirect’ is closed to new replies.