Simple Membership Plugin › Forums › Simple Membership Plugin › Redirect Code
Tagged: Redirect Code
- This topic has 15 replies, 3 voices, and was last updated 10 years, 1 month ago by
Myroslav.
-
AuthorPosts
-
September 27, 2014 at 7:45 pm #358
fmcmellon
ParticipantTrying to set users “Home” link based on their Simple Membership Redirect. What code could I use to do this?
September 28, 2014 at 2:55 am #361admin
KeymasterUse the following addon so you can specify a “Welcome/Home Page” for each membership access level.
https://simple-membership-plugin.com/configure-login-redirection-members/
October 1, 2014 at 5:07 pm #385fmcmellon
ParticipantI already have that installed. My question is what is the code that redirects them to their main landing page?
The problem is the logo on our main website will bring them to the main home site. I want to have “home link” that redirects them to their main redirect
October 1, 2014 at 11:46 pm #388admin
KeymasterThis addon probably won’t do what you are after. This addon basically redirects the user to a page AFTER they log in via the membership login page.
October 3, 2014 at 2:14 am #390fmcmellon
ParticipantIf you provided the direction to what the actual redirect code is yes it could be easily added
October 5, 2014 at 4:48 pm #395fmcmellon
ParticipantCan anyone help?
I am trying to add a link that will direct the logged in user back to their “homepage”
It needs to call their login redirect page somehow?
October 5, 2014 at 4:50 pm #397fmcmellon
Participanta href="<?php echo wp_redirect($after_login_page_url = BMembershipLevelCustom::get_value_by_key($level_id, $key)); ?>" title="Login">Login</aOctober 7, 2014 at 3:34 pm #410fmcmellon
ParticipantSupport for this plugin sucks
October 7, 2014 at 9:47 pm #414admin
KeymasterThe following should do:
$auth = BAuth::get_instance(); if ($auth->is_logged_in()) { $level = $auth->get('membership_level'); $level_id = $level; $key = 'swpm_alr_after_login_page_field'; $after_login_page_url = BMembershipLevelCustom::get_value_by_key($level_id, $key); echo '<a href="'.$after_login_page_url.'">Go to Welcome Page</a>'; }October 8, 2014 at 4:17 am #416fmcmellon
ParticipantCould you please show me how to use this as a link? When I do what you are saying I get the following
$auth = BAuth::get_instance(); if ($auth->is_logged_in()) { $level = $auth->get('membership_level'); $level_id = $level; $key = 'swpm_alr_after_login_page_field'; $after_login_page_url = BMembershipLevelCustom::get_value_by_key($level_id, $key); echo 'Go to Welcome Page'; }That shows up on the page. The Go to Welcome Page is clickable however it brings me to a blank 404 page with sitename/membership-login/’.$after_login_page_url.’
October 8, 2014 at 4:23 am #417fmcmellon
ParticipantI am trying to figure out how to link the header image to bring you directly to your welcome page. Has no one asked this question?
October 9, 2014 at 10:36 am #419admin
KeymasterI don’t think you will be able to do that for the header image unfortunately.
October 9, 2014 at 1:14 pm #420fmcmellon
ParticipantRegardless the link you provided is incorrect and does not work
May 1, 2016 at 11:56 pm #6796Myroslav
ParticipantFor guys who still have the same problem.
This works for me:
“>My Profile
I put this into my widget but for that you should enable the opportunity to use php code in your widget area. Here’s the explanation : http://www.emanueleferonato.com/2011/04/11/executing-php-inside-a-wordpress-widget-without-any-plugin/Also you should follow the update documentation as in previous version the function was “swpm_after_login_url” and not “swpm_alr_after_login_url”.
Hope this help anyone.
May 1, 2016 at 11:58 pm #6797Myroslav
ParticipantOh my, it cleared it all.
The example was:
““>My Profile“ -
AuthorPosts
- You must be logged in to reply to this topic.