Leave a Reply

2 comments

  1. 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() ;?>
    
  2. 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.