0

I read this tutorial, here the author names the template custom-register.php and puts it in the theme dir and doesn't explain about how it's loaded by WP, I did the same way but the file didn't loaded on request to the WP signup.

What's the trick here?

1 Answer 1

1

Be sure to link that page in your functions page

require_once('custom-register.php')

cp_head(__('Register','cp'));
    ?>
        <?php cp_show_errors($errors); ?>
       <div class="alert alert"><a class="close" data-dismiss="alert">×</a><strong>Welcome: </strong> 
            <?php _e('Complete the fields below to become a member.', 'cp') ?>
          </div>

       <div class="alert alert-info"><a class="close" data-dismiss="alert">×</a><strong>Information: </strong> 
            <?php _e('Your password will be mailed to you so use valid email address.', 'cp') ?>
          </div>
        <div class="row">
<form class="loginform" name="registerform" id="registerform" action="<?php echo site_url('wp-login.php?action=register', 'login_post') ?>" method="post">
        <div class="span4">
       <label>Username</label>
      <input class="input-xlarge focused" name="user_login" type="text" id="focusedInput" value="<?php echo attribute_escape(stripslashes($user_login)); ?>"  /> 
      </div>


        <div class="span4"> 

     <label>Email</label>
      <input class="input-xlarge focused" name="user_email" type="email" id="focusedInput" value="<?php echo attribute_escape(stripslashes($user_email)); ?>"  />

      </div>

         <div class="span4"> 
    <?php do_action('register_form'); ?>
      <input class="btn btn-success" name="wp-submit" value="Send" type="submit" style="height:52px; width:280px;" />
      </div>

</form>
</div>
        <?php cp_footer_div() ?>

Should give you an output like http://www.evo3dmovies.com/wp-login.php?action=register

7
  • if I directly link to the template, how can I use wp features (like $user_id, wp_create_user(), ...) in the template without loading of wp core?
    – csstd
    Commented Apr 17, 2013 at 11:14
  • The page you have created you need to link to functions php and let wordpress do the rest. Dont directly link to the page. Commented Apr 17, 2013 at 11:17
  • sorry, i need a little more explanation, You mean functions.php in wp-includes? and how should I link to my page in that file, so on the signup request my page loaded? thanks
    – csstd
    Commented Apr 17, 2013 at 11:34
  • 1
    No the functions.php in your theme folder. I told you how to link it in the answer above. require_once('custom-register.php'); Commented Apr 17, 2013 at 12:00
  • ok, i didn't know when you request wp-login.php, the functions.php of the theme also loaded, so in functions.php I need to check the action query var for including the 'custom-register.php`?
    – csstd
    Commented Apr 17, 2013 at 12:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.