latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Customized Login Widget Re-direct

Home Forums Community Forum Customized Login Widget Re-direct

This topic contains 1 reply, has 2 voices. Last updated by  Bruce 4 years, 2 months ago.

Topic Author Topic
Posted: Wednesday Oct 10th, 2012 at 10:33 pm #28069

Hi there,

I really liked the way s2member implemented the login widget on this site, so I did the same on my own. It works great— except that it does not redirect to the Login welcome page on login, it just goes back to the root.

I’m hoping that you will see my error?

<div class="sublogin">
<div class="loginlink"><h4 id="s2memberlogin" title="Sign In" style="cursor:pointer;">
<?php 
if (is_user_logged_in()){  ?>
<a href="<?php echo wp_logout_url( home_url() ); ?>" title="Logout">Sign out</a>
<?php }
else { ?>
Sign In  <?php } ?>
<span id="expanderSign" style="display:none;"> +</span></div>
<div id="s2-login-box" style="display:none">
<div class="ws-plugin--s2member-pro-login-widget">
<form method="post" action="http://www.nowsayit.com/wp-login.php" class="ws-plugin--s2member-pro-login-widget-form">
<div class="ws-plugin--s2member-pro-login-widget-username">
<label for="ws-plugin--s2member-pro-login-widget-username">Username:</label><br />
<input type="text" name="log" id="ws-plugin--s2member-pro-login-widget-username" title="Username" />
</div>
<div class="ws-plugin--s2member-pro-login-widget-password">
<label for="ws-plugin--s2member-pro-login-widget-password">Password:</label><br />
<input type="password" name="pwd" id="ws-plugin--s2member-pro-login-widget-password" title="Password" />
</div>
<div class="ws-plugin--s2member-pro-login-widget-lost-password">
<a href="http://www.nowsayit.com/register" tabindex="-1">signup now</a> | <a href="http://www.nowsayit.com/wp-login.php?action=lostpassword" tabindex="-1">forgot password?</a>
</div>
<div class="ws-plugin--s2member-pro-login-widget-remember-me">
<label><input type="checkbox" name="rememberme" value="forever" />Remember Me</label>
</div>
<div class="ws-plugin--s2member-pro-login-widget-submit">
<input type="hidden" name="redirect_to" value="/members" />
<input type="submit" value="Sign Me In" />
</div>
</form>
<div class="ws-plugin--s2member-pro-login-widget-code">
</div>
<div style="clear:both;"></div>
</div>
</div></div>

Many Thanks!

List Of Topic Replies

Viewing 1 replies (of 1 total)
Author Replies
Author Replies
Posted: Wednesday Oct 10th, 2012 at 10:42 pm #28072
Bruce
Username: Bruce
Staff Member

Hi Scott,

WordPress already has a built-in feature for this. Just change the action=”” portion of your form to include the redirect_to argument:

<form method="post" action="http://www.nowsayit.com/wp-login.php?redirect_to=/my-login-welcome-page" class="ws-plugin--s2member-pro-login-widget-form">
Viewing 1 replies (of 1 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.