1. KCTeck

    Great work! And thanks, very timely for me. I’ll be giving it a test this weekend. When me work slows down – I’d really like to learn more from you!

    • Pippin

      Glad to help! Once you’ve gone through it, feel free to post your results here for all to see. I’m really excited to show everyone the full plugin that is coming from this as well.

  2. paul

    Pippin,

    why not use wp_login_form() for the login part?
    Also, do you know how to add custom fields to ther registration form, and server-side validation?

    • Pippin

      @Paul – the advantage of using the custom login form is that you get complete control over it, including error handling. The other reason is just for example. Whether it makes sense for you or not, it is still very useful to know how it is done.

      Custom registration fields are actually quite easy. Simply add more fields to the form itself (in the HTML), then after the user has been created with wp_insert_user(), use the Update_user_meta() functions to store the additional data.

    • Pippin

      @Nick – That is a good suggestion. In this case, obviously you can choose to redirect them where ever you wish. The final result of this tutorial is not necessarily meant be to a 100% finished product. There are lots of places it could be improved for that. I’m going to be releasing a finished plugin in the repository that will have those options added.

  3. jorgemartinez178

    Muy Buen Tutorial Encantado con todos los recursos que das en tu blog 😀

  4. deckerweb

    Hi Pippin! As always, great tutorial! 🙂
    One thing I would just suggest to add to it:
    1) call of “load_plugin_textdomain” with proper parameters
    2) an actual textdomain to all the strings
    This way it will go with WP standards and if ever a user just does copy & paste they are prepared for DISPLAYING actual translations out of the box.
    I would suggest doing so with all of your code pieces here.
    I know how add these two things myself but majority of users do not and begin mixing it all up once they or their client needs another language.
    And use case is not only for international users: a lot of users from the U.S. are doing bilingual sites in English and Spanish (for example via WPML plugin) and therefore need proper localized plugins and themes.
    Sorry for lengthy comment but this topic is very important for me 🙂

    • Pippin

      Good notes David! The only reason I didn’t was because this wasn’t designed to be a ready to use plugin out of the box. Yes, it works out of the box, but it really needs some more polishing before it’s truly ready. I’m going to do some more work on it and create two different “official” versions: one for free that will go on the WP repository, and one that will go on Code Canyon. I’m expecting to release both of these within the next two weeks.

      I’ll link to them from here when they’re ready.

  5. drewmcmanus

    This is a terrific series Pippin! I ws wondering if you might add one more installment on getting the custom post types to display properly within the standard singlepost template. I still can’t get the custom post types to display properly on the front end (using thematic)

    • Pippin

      @Drew – Thanks! But I think you’re posting this on the wrong page 😛 Did you mean to post this on the Displaying Content with ECPT ?

  6. drewmcmanus

    D’oh! You’re absolutely correct! Sorry about that, I’ll re-post it over there (go ahead and delete it here if needed).

  7. nickopris

    Great tutorial and I assume it will be followed by one with image upload…

    • Pippin

      @Nick – An image upload for user portfolios?

  8. nickbudden

    Are you planning a forgot your password form tutorial as a followup?

    • Pippin

      @nickbudden – Yes, I do plan to follow this one up with that topic as well.

      Sorry for being slow. Your comment got caught by the spam filter and I didn’t see it.

    • Pippin

      Nick, in cased you missed it, I’ve published a tutorial on creating a “Change Password” form. I’ll probably follow it up soon with the “Forgot Password” form.

  9. smriti

    hello pippin in a new to this wordpress..when i uploaded this plugin…I am unable to access it in my front-page…any Help!

    thanks

    • Pippin

      @smriti – Did you put the short code in a page?

  10. smriti

    I have downloaded the plugin which you have provided and uploaded in my wordpress….

    • Pippin

      Does it show an error of any kind? Or just a blank white screen?

  11. smriti

    I have activated the plugin…but don’t know the next step…plz help!

    • Pippin

      The plugin will provide two short codes:

      [login_form] – this will show the login form.

      [register_form] – this will show the registration form.

      Simply put these in a post or page, or textwidget.

  12. smriti

    using this [register_form] in my page…no form is displayed.

    • Pippin

      Are you viewing the page logged in? The register form will only show if you are logged out.

  13. Kousikb

    i put [register_form] in the page. it’s showing ‘User registration is not enabled’. How to enable that?

    Also [login_form] is not showing anything. Please help

    • Pippin

      For the registrations, go to Settings > General and click Anyone Can Register.

      For the login form, are you currently logged in when viewing the page?

  14. FanaticWeb

    Pippin! You’re the best! As always, QUALITY and PREMIUM support! Cant wait for an official release of this plugin since I’ve been going crazy looking for one as such, I dont mind going for the Code Canyon version to encourage your work.

    Happy Holidays and Happy new year in advance!

    • Pippin

      Thanks! The official plugin is finished and will be for sale here on the site, or free if you’ a paid subscriber.

  15. FanaticWeb

    Pippin, one request I would have for this front end login plugin is the possibility of placing it either as a short-code or a link within the header menu of a theme with a sliding div displaying the fields, or maybe just a pop-up after clicking on the Login link?

    • FanaticWeb

      Sorry, just realised this whole plugin is based on short codes which I figured out [login_form] but how to widgetize it or get it to display the same way as you have it here on your blog?

    • Pippin

      To use it in a widget, simply place it in a text widget. You might have to add a function to the plugin to make it render in your text widgets, but try it.

      The official version of the plugin includes a widget for each login, registration, and change password forms.

  16. tr3online

    If I dl the plugin, install it, activate it, make a page and put [login_form], I get nothing. Anyone else?

    • Pippin

      Are you viewing the page logged in or out? The login form will only show if you are logged out.

    • tr3online

      Yeah, that was the issue. I had some session problems. I clicked log out to check but apparently I wasn’t really. Fixed that and it’s working now. Thanks for the speedy response!

    • Pippin

      Yep, that would do it. One little trick that I use a lot of times (especially when dealing with logged in / out functionality), is to open the site in two different browsers. Let one be logged in, and one logged out.

  17. griggsjared

    Great tutorial.

    One thing that I noticed going through it. The get_userdatabylogin() function used in the pippin_login_member() function is depreciated according to the WordPress codec and should be replaced by get_user_by(‘login’, $user_login).

    http://codex.wordpress.org/Function_Reference/get_userdatabylogin

    • Pippin

      Yes, you’re right, it has been depreciated. The plugin based off of this tutorial has been updated already.

  18. carolineorlando

    Pippin,

    Great tut. Did you ever have a chance to post a piece on how to reset the password/submit a form to resend the password information to the user via email?

    If not, is it included in your paid version?

    Let me know. Thanks!

    Best,
    C

    • Pippin

      No, I have not posted that tutorial yet, though it is still on the list.

  19. carolineorlando

    Great! Can’t wait to see it, one more question:

    In the login form above – is there a way to add the ability to login with email, too? I tried playing with the code, changing:
    $user = get_user_by('login', $_POST['pippin_user_login']);
    to
    $user = get_user_by('email', $_POST['pippin_user_email']);

    But that didn’t work. Do you have any thoughts? (It could either be login JUST with email, or login with EITHER email or username)

    Let me know. Thanks, Pippin!

    • Pippin

      You will have to edit more than just that one line to allow users to login via email. Does that get_user_by() successfully retrieve the user info?

  20. carolineorlando

    P,

    Yes – it does for user_login, not for user_email. But like you said, that is because I have to change a few more things around. Can I email you what I’ve got? If you could take a look I’d appreciate it!

    Best,
    C

    • Pippin

      Sure, send it over. It might be a day or two before I can get to it, but I will.

  21. carolineorlando

    P,

    I don’t have your email, if you could send me a blank email (so I have your address) to carolineorlando@gmail.com that would be great – but here is a little bit of what I tried messing with. You’d think it would process but it doesn’t. I’m not sure why?


    // login form fields
    function pippin_login_form_fields() {
    ob_start(); ?>

    Username

    Password

    <input type="hidden" name="pippin_login_nonce" value=""/>

    add('invalid_email', __('Invalid email'));
    }

    // same thing with the "or" statement here... thoughts?

    if(!isset($_POST['pippin_user_pass']) || $_POST['pippin_user_pass'] == '') {
    // if no password was entered
    pippin_errors()->add('empty_password', __('Please enter a password'));
    }

    // check the user's login with their password
    if(!wp_check_password($_POST['pippin_user_pass'], $user->user_pass, $user->ID)) {
    // if the password is incorrect for the specified user
    pippin_errors()->add('empty_password', __('Incorrect password'));
    }

    // retrieve all error messages
    $errors = pippin_errors()->get_error_messages();

    // only log the user in if there are no errors
    if(empty($errors)) {

    wp_setcookie($_POST['pippin_user_email'], $_POST['pippin_user_pass'], true);
    wp_set_current_user($user->ID, $_POST['pippin_user_email']);
    do_action('wp_login', $_POST['pippin_user_email']);

    wp_redirect(home_url()); exit;
    }
    }
    }
    add_action('init', 'pippin_login_member');

  22. carolineorlando

    Nevermind the above, that was a copy-and-paste fail. I’ll have to email it to you!

  23. bryceadams

    I noticed a typo in this part:


    // displays error messages from form submissions
    function pippin_show_error_messages() {
    if($codes = pippin_errors()->get_error_codes()) {
    echo '';
    // Loop error codes and display errors
    foreach($codes as $code){
    $message = pippin_errors()->get_error_message($code);
    echo '' . __('Error') . ': ' . $message . '';
    }
    echo '';
    }
    }

    Line 8 says: echo ‘<pan …
    Should say: echo '<span

    🙂

    • Pippin

      Thanks for catching it!

  24. asfaquz

    Superb .Your tutorials and way of presentation is really wonderful.Thanks a lot.

  25. eshin

    This is a GREAT plugin! I’m fairly new to WP and this worked in widget mode right out of the box. I’m happy to have bought it in support of your work. Thanks!!!

    One suggestion. Have a Redirect on logout in WP | Setting | FERALS. I don’t want to get into the code as I don’t know any except css. Also, if I was to get someone to code this it would be overlaid when a new version is installed. Right?

    If I’ve get WP right – I’d have to go into the plugin folder, find forms.css and change any styling there? I’d like to make it closer to the theme I have on the site. Colors, etc. Is there a way to have this accessible from the WP Dashboard somewhere. Again, so it’s not overwritten by a new version.

    Thanks again

    • Pippin

      Thanks for the support and suggestions!

      In this case, you will have to modify the plugin files in order to make changes. There are no options in the dashboard, sorry.

  26. taanshei

    Hi,

    First of all, thx for your nice tutorial.

    I have a little request : I added some custom fields and I would like to see them in the dashboard when I consult the registred users as admin.

    What is the way to process ?

    Thx 🙂

    • Pippin

      You will want to research the update_user_meta() and get_user_meta() functions.

  27. bloodstriker

    hello- i just wanted to ask , how can u implement this into your site and then use some buttons like login/logout , for the members to use there information from this registration form .
    understand me?

    like the unregister cant see some pages, and when they log in – they could…
    but how to create the login/logout menu ???
    10x in advance

    best wishes – BloodstrikeR
    Respect

    • Pippin

      You can use the wp_loginout() function.

  28. johnlanglois

    I have purchased the plug-in and saw your note that read “Custom registration fields are actually quite easy. Simply add more fields to the form itself (in the HTML), then after the user has been created with wp_insert_user(), use the Update_user_meta() functions to store the additional data.”

    Do I need to add the new fields to the code in “handle-register-and-login.php”? If not, how would adding a field to the HTML of the page capture the nature of the field? For example, I need a field that would allow the user to upload a file. Is there an additional plug-in that I should consider?

    Thank you.

    • Pippin

      You will add the field HTML in the forms.php file and then the update_user_meta() calls inside of handle-register-and-login.php. Make sense?

  29. gstricklind

    Thank you for posting this!
    I’m getting a lot of errors with WP 3.5. I know this was initially created a year ago. I tried to fix some of the errors but am unsuccessful. Do you have a new post about setting this up or is your plugin up-to-date?
    Thanks!

    • Pippin

      Can you please indicate the errors you are getting?

Comments are closed.