Is there a way to display the WordPress register form on a custom page the way one would use <?php get_search_form( $echo ); ?>
for a search form? If not how would one go about creating such a template? I would like to do this without Ajax btw. Any pointers/ideas are very welcome!
-
This might help you: wordpress.org/extend/plugins/simplr-registration-form– dipaliApr 9, 2013 at 10:34
-
I recommend the plugin "Theme My Login". It creates common Wordpress pages which you can apply templates to and style as you wish.– NahuelApr 11, 2013 at 19:31
2 Answers
Here is a function I've Used Before:
function registration_form_wpa95139(){
if (is_user_logged_in()) return;
?>
<div class="Registration">
<div id="register-form">
<div class="title">
<h1><?php _e('Register your Account'); ?></h1>
<span><?php _e('Sign Up with us and Enjoy!'); ?></span>
</div>
<form action="<?php echo site_url('wp-login.php?action=register', 'login_post') ?>" method="post">
<input type="text" name="user_login" value="Username" id="user_login" class="input" placeholder="Username" />
<input type="text" name="user_email" value="E-Mail" id="user_email" class="input" placeholder="E-Mail" />
<?php do_action('register_form'); ?>
<input type="submit" value="<?php _e('Register'); ?>" id="register" />
<hr />
<p class="statement"><?php _e('A password will be e-mailed to you.'); ?></p>
</form>
</div>
</div><!-- /Registration -->
?>
}
and you can call it like this:
<?php registration_form_wpa95139() ;?>
-
Thanks, this worked! One last thing, a handy redirection so it doesn't take the user backend.
<input type="hidden" name="redirect_to" value="/success"/>
Apr 10, 2013 at 9:53
Use this to redirect users to the page they were viewing before they were asked to log in/register <?php if (!is_user_logged_in()) auth_redirect(); ?>
Put it at the very top (line 1) of the page templates you want to make private before you call the header. Let me know if you have any problems.
-
Is it better to use that than
<input type="hidden" name="redirect_to" value="/success"/>
? If yes why? Apr 10, 2013 at 11:25