Membership Plugin

WordPress Membership Plugin

  • Home
  • Documentation
  • Addons
  • Support
    • Quick Setup
    • Documentation
    • Premium Addon Support
    • Paid Support
    • Support Forum
    • Support Forum Search
    • Forum Login
    • Forum Registration
  • Contact

[Support request] How to redirect when user is logged in & on login page

Simple Membership Plugin › Forums › Simple Membership Plugin › How to redirect when user is logged in & on login page

  • This topic has 8 replies, 2 voices, and was last updated 8 years, 6 months ago by mbrsolution.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • June 4, 2018 at 5:41 am #14604
    Sunshine
    Participant

    Hi, thank you for the awesome plugin.
    I created a login page and members of different levels are redirected to the designated page after login.
    However, when a logged member access the login page and enter Username and password again,
    the logged member has not been redirected to the destination page and it remains on the same page.
    May I know how to redirect my logged users to the designated page according to their member level?

    Here is the login page I have created.
    http://hajiwon-sunshine1023.com/secret-garden

    June 4, 2018 at 11:32 am #14606
    mbrsolution
    Moderator

    Hi,

    However, when a logged member access the login page and enter Username and password again,

    Let me see if I get what you mean. You are saying that a member logs in. Then while the member is logged in, they try to log into WordPress as a WP User, is this correct?

    Regards

    June 4, 2018 at 3:53 pm #14607
    Sunshine
    Participant

    Thank you for your reply.

    For example, When a member logs in for the first time from the login page,
    he was redirected to the designated page successfully after login.
    Then while the member is logged in and accesses the login page again,
    he was not redirected to the designated page.
    So he entered the username and password again but he was not redirected to the designated page neither.

    My question is how can I redirect the logged member to the designated page when he accesses the login page again?
    For your information, I am using the following code on the login page.

    <form id=”swpm-login-form” action=”” method=”post” name=”swpm-login-form”>
    <div class=”swpm-login-form-inner”>
    <div class=”swpm-username-label”><label class=”swpm-label” for=”swpm_user_name”>Username or Email</label></div>
    <div class=”swpm-username-input”><input id=”swpm_user_name” class=”swpm-text-field swpm-username-field” name=”swpm_user_name” size=”25″ type=”text” value=”” /></div>
    <div class=”swpm-password-label”><label class=”swpm-label” for=”swpm_password”>Password</label></div>
    <div class=”swpm-password-input”><input id=”swpm_password” class=”swpm-text-field swpm-password-field” name=”swpm_password” size=”25″ type=”password” value=”” /></div>
    <div class=”swpm-remember-me”><span class=”swpm-remember-checkbox”><input name=”rememberme” type=”checkbox” value=”checked=’checked'” /></span>
    <span class=”swpm-rember-label”> ログイン情報を保存</span></div>
    <div class=”swpm-before-login-submit-section”></div>
    <div class=”swpm-login-submit”><input class=”swpm-login-form-submit” name=”swpm-login” type=”submit” value=”Login ログイン” /></div>
    <div></div>
    <div class=”swpm-forgot-pass-link”>パスワードを忘れた?</div>
    <div class=”swpm-login-action-msg”></div>
    </div>
    </form>

    June 4, 2018 at 4:58 pm #14608
    Sunshine
    Participant

    May I know if the following code is correct if I want to redirect the members of a particular member level to the designated page? I am going to add the following code in loggedin.php.

    <?php
    if (SwpmMemberUtils::is_member_logged_in()) {
    $member_level = SwpmMemberUtils::get_logged_in_members_level();
    if ($member_level == “2”) {
    wp_redirect( ‘URL’ );
    exit;}
    }
    ?>

    June 4, 2018 at 11:38 pm #14610
    mbrsolution
    Moderator

    Hi, have you tested the following addon?

    June 4, 2018 at 11:47 pm #14611
    Sunshine
    Participant

    yes, it works well when the user log in for the first time.
    But when the member is logged in and access the login page again, only the user details (loggedin.php) were shown.
    The user has not been redirected to the designated page.

    June 5, 2018 at 12:01 am #14612
    mbrsolution
    Moderator

    Hi,

    But when the member is logged in and access the login page again, only the user details (loggedin.php) were shown.

    I am not following the step above. Why would the user visit the login page again, if they are already logged in?

    only the user details (loggedin.php) were shown.

    That is the correct function after the member is logged in. Only the members details will be revealed.

    Are you wanting to redirect a member once they are logged in and visit the login page again to the last accessed URL? If that is the case, unfortunately that function is not currently available in the plugin.

    Kind regards

    June 5, 2018 at 1:58 am #14613
    Sunshine
    Participant

    Thanks for the explanation.
    I would like to create some secret pages for different level of users.
    User has to visit the login page again because I don’t want to reveal the link of the page that members of different levels will be redirected to.
    Therefore I didn’t create any link to the secret pages at the login page which is the entrance of the member only area.

    Once the member is logged in, I hope the user will be redirected to a specific page when he visits the login page again.
    Would it be possible to do that ?

    June 5, 2018 at 4:17 am #14614
    mbrsolution
    Moderator

    Hi, I see what you are trying to achieve. In your case the easiest way to achieve this is using the Form Builder addon. This addon allows you to add a URL link to a members profile based on their membership level.

    Let me know if this would work for you.

    Kind regards

  • Author
    Posts
Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.
Log In

Please read this message before using our plugin.

Search

Featured Addons and Extensions

  • Membership Form Builder Addon
  • Member Directory Listing Addon
  • WooCommerce Payment Integration
  • Member Data Exporter Addon

Documentation

  • Documentation Index Page

Copyright © 2026 | Simple Membership Plugin | Privacy Policy