March 14, 201214 yr Hi everyone, I'm creating a membership site using 'Membership' from WPMUDev (http://premium.wpmudev.org/project/membership). Is there a simple (or slightly challenging) way to create a login form that is accessed from the front end of the website? I'd prefer it if non-administrators didn't go near '/wp-login.php'. I had assumed there would be one included with the plugin, but I'm yet to find it. Cheers, Chris Edited March 14, 201214 yr by Chris Higgins
March 14, 201214 yr Just copy the form from wp-login.php, adding a hidden field called "redirect_to" populated with the URL of the current page.
March 14, 201214 yr or try this https://github.com/mikejolley/sidebar-login Good find, but why on earth would someone use GitHub for a WP plugin? It totaly fails to take advantage of the WP update mechanism, which you get automatically by storing your plugin in the wordpress.org SVN repo.
March 14, 201214 yr Good find, but why on earth would someone use GitHub for a WP plugin? It totaly fails to take advantage of the WP update mechanism, which you get automatically by storing your plugin in the wordpress.org SVN repo. Cos it's for cool kids, yo.
March 14, 201214 yr Good find, but why on earth would someone use GitHub for a WP plugin? It totaly fails to take advantage of the WP update mechanism, which you get automatically by storing your plugin in the wordpress.org SVN repo. To be honest I've no idea! Same thing is found here.. http://wordpress.org/extend/plugins/sidebar-login/ I've not tried it myself but it seems to get mixed reviews
March 14, 201214 yr Hi, I would strongly recommend the plugin theme my login! http://wordpress.org/extend/plugins/theme-my-login/ Works like a treat and Is super simple to set up! I use it on my wordpress sites, http://www.astralkarate.co.uk/login/ you will see what its like
March 15, 201214 yr Author Just copy the form from wp-login.php, adding a hidden field called "redirect_to" populated with the URL of the current page. Sounds easy enough... I've copied what I think is the right code from wp-login.php, and it does result in a login form on the front end of the site. Mission accomplished. I'm a bit confused by the hidden field bit. I replaced the value on the second last line of the code to my websites URL, and it seems to work. Is that all I have to do? <form name="loginform" id="loginform" action="<?php echo esc_url( site_url( 'wp-login.php', 'login_post' ) ); ?>" method="post"> <p> <label for="user_login"><?php _e('Username') ?><br /> <input type="text" name="log" id="user_login" class="input" value="<?php echo esc_attr($user_login); ?>" size="20" tabindex="10" /></label> </p> <p> <label for="user_pass"><?php _e('Password') ?><br /> <input type="password" name="pwd" id="user_pass" class="input" value="" size="20" tabindex="20" /></label> </p> <?php do_action('login_form'); ?> <p class="forgetmenot"><label for="rememberme"><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="90"<?php checked( $rememberme ); ?> /> <?php esc_attr_e('Remember Me'); ?></label></p> <p class="submit"> <input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php esc_attr_e('Log In'); ?>" tabindex="100" /> <?php if ( $interim_login ) { ?> <input type="hidden" name="interim-login" value="1" /> <?php } else { ?> <input type="hidden" name="redirect_to" value="http://www.myurl.com/" /> <?php } ?> <input type="hidden" name="testcookie" value="1" /> </p> </form>
March 15, 201214 yr That field gives you the opportunity to either redirect the user to the same page they logged in from or a page of your choosing on successful login - it's passed to wp-login.php, which handles the form submission.
March 15, 201214 yr Just copy the form from wp-login.php, adding a hidden field called "redirect_to" populated with the URL of the current page. Actually that's a good tip - I think I will employ that on a future build. +1
Create an account or sign in to comment