Display WordPress login form anywhere in the theme

Written by on August 8, 2010 in General - 1 Comment

WordPress 3.0 (among the other cool features) allows to display login page anywhere in the theme or even in the post itself (if you write a plugin of course), it’s actually done with just one line of code.

wp_login_form()

This code will “echo” the form (it’s a simple form without any styling applied to it so that’s a good thing). Like with everything in WordPress wp_login_form allows for easy customization by passing array of arguments to the function. I won’t describe it here checkout function source in wp-includes/general-templates.php line 250 (we are talking WP 3.0 of course).

About the Author

Greg Winiarski is a freelance PHP and JavaScript programmer. He specializes in web applications and WordPress development.

One Comment on "Display WordPress login form anywhere in the theme"

  1. Pradeep September 5, 2010 at 2:05 pm ·

    Is it possible to show the login form (userid/password and remember me fields) in the right bar in meta contents?
    If yes, how?

Leave a Comment