WP-Members: Membership Framework
[resolved] Login Page Redirect (4 posts)

  1. pastoradeola
    Posted 3 years ago #

    Please I need help redirecting my login page in Wp-members. My website is http://www.christembassyarlington.org. I have a link for people to click to watch live church service but I want them to login or register first before being able to do so and then redirected to the live-service page after login is successful.


  2. pastoradeola
    Posted 3 years ago #

    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
    always redirected to
    when a member is already logged in.

  3. Chad Butler
    Plugin Author

    Posted 3 years ago #

    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/' );

    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'

  4. pastoradeola
    Posted 3 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP-Members: Membership Framework
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic