Using jQuery to liven up your WordPress login

Image by: maistora
When I’m coding a project for a client, I always try make using the site as easy as possible. Whether it be using custom fields to automate the use of images in a post, or coding wp-admin pages to make the writing of posts & pages easier for them to do. Less is more… So in applying this principle, I’m going to show a really quick method of simplifying the clients login process using a jQuery lightbox.
Here’s a demo of what we’re going to do.
Just in case you’ve been coding in a box for the last 10 years, jQuery is a great JS library that has a number of nifty usages. One of its popular plugins is the ‘thickbox‘ and its what we’re going to use now to create a simple means of logging in for you/your clients.
Prepare your site
In your header.php file you need to include 3 files: jquery.js, thickbox.js and thickbox.css. Then upload the included loading.gif animation to your images folder. The includes for these files would look like this:
<script type="text/javascript" src="<? bloginfo('template_directory'); ?>/jquery-latest.pack.js"></script>
<script type="text/javascript" src="<? bloginfo('template_directory'); ?>/thickbox-compressed.js"></script>
<link rel="stylesheet" type="text/css" href="<? bloginfo('template_directory'); ?>/thickbox.css" media="screen" />
NOTE: call the jquery file before the thickbox.js file.
Then open your thickbox.js file and edit the path to your theme’s images folder. It’ll look something like this:
var tb_pathToImage = "/wp-content/themes/yourtheme/images/loadingAnimation.gif";
Ok, now your site is thickbox’d. Nice.
Make it happen
Of the many usages of the thickbox, the one we’re going to use now is the thickbox for Inline Content. In essence, you’re going to have your login form somewhere on your page (preferably in an element that is included on every page on your site like your sidebar) but its going to be hidden by an inline CSS style:
<div id="form" style="display:none;">
Somewhere else on your page, you’re going to have a link (like in your topnav) that when clicked, will open that hidden div/form in the thickbox. This link will have, instead of a URL as its href target, some magic thickbox commands that will summon your hidden login form. The link would be as follows:
<a href= "#TB_inline?height=200&width=200&inlineId=form" title="Login to the WP Guru site">Login</a>
What’s happening here is that the link is calling an inline div that’ll be displayed in a thickbox with the sizes specified and you’re identifying the inline div ID that will be called. Note that class=”thickbox” is critical to the thickbox’s successful usage.
The login form
The actual login form can be simplified down to its core elements so that you have nice neat code made up of only what you need. You can of course tweak this to be just what YOU need. The actual login form is found around line 378 in the wp-login.php file (v2.5).
<div id="form" style="display:none;">
<form name="loginform" id="loginform" action="http://wpguru.co.za/wp-login.php" method="post"><input type="hidden" name="phpMyAdmin" value="01d7dd3a1764f33b9145cd20ad99db24" />
<p>
<label>Username<br />
<input type="text" name="log" id="user_login" value="" size="20" tabindex="10" /></label>
</p>
<p>
<label>Password<br />
<input type="password" name="pwd" id="user_pass" value="" size="20" tabindex="20" /></label>
</p>
<?php do_action('login_form'); ?>
<p><label><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="90" /> Remember Me</label></p>
<p>
<input type="submit" name="wp-submit" id="wp-submit" value="<?php _e('Log In'); ?>" tabindex="100" />
<input type="hidden" name="redirect_to" value="/" />
<input type="hidden" name="testcookie" value="1" />
</p>
</form>
</div>
You can of course style up the div that contains your form with your site logo etc to make the whole login process seem even more bespoke.
TIP: You can set the overlay color of your jQuery thickbox (default set to 75% black) to match your site, in line #39 of your thickbox.css file.
93 Comments
Trackbacks
- Today In WordPress :: WordPress Upgrades
- 26 Nisan web’den seçme haberler » Tekil Yazı » Fatih Hayrioğlu'nun not defteri
- Güzel bir Wordpress giriş paneli » Bilgisayar Hocası
- [ fatih hayrioğlu ]26 Nisan Seçmeler « CSS Arşiv
- Local company spams top SA bloggers! | iMod
- Free WordPress and jQuery: 25+ Useful Plugins & Tutorials | designersmantra.com
- All my bookmarks ever | Daniel John Gayle
- The Power of WordPress and jQuery: 25+ Useful Plugins & Tutorials | Quest For News, A TUTORIAL Base
- 15 Plugins to Unleash the Invincible Power of jQuery and Wordpress
- Today in WordPress world - 20/07 | Links | WereWP
- 30 Tutorials Combining Both Wordpress and jQuery : Speckyboy Design Magazine
- 30 Tutorials Combining Both Wordpress and jQuery | huibit05.com
- 13 Plugins para soltar o poder do jQuery no Wordpress « Xigli
- 30 Tutorials Combining Both Wordpress and jQuery | .::tek3D Weblog::.
- 35 Stylish And Modern Wordpress Plugins Using jQuery UI | Graphic and Web Design Blog - Inspiration, Resources and Tools
- 35 elegantes y modernos Plugins para Wordpress usando jQuery UI | Don Pipa.com, web oficial
- 35 Stylish And Modern Wordpress Plugins Using jQuery UI | pc-aras
- 30 Tutorials for Using JQuery in Wordpress | oOrch Blog
- 35 Stylish And Modern Wordpress Plugins Using jQuery UI - Programming Blog
- 40+ Quite Useful Wordpress Plugins using jQuery | tripwire magazine
- Fesches Ajax Login Formular | Medienbeckerei Blog
- Lorelei Web Design » 75 Best Wordpress Plugins That Make Bloggers Lives Easier
- 35 Stylish and Modern Wordpress Plugins using jQuery UI | AlexVerse
- The Power of WordPress and jQuery: 25+ Useful Plugins & Tutorials | HOSTERWARE UK. Tel 02081337636
- Представляю Вашему вниманию - jquery плагины для wordpress | Okinak
- 30 tutorial para utilizar jQuery en nuestro Wordpress | code
- 35 Stylish And Modern Wordpress Plugins Using jQuery UI » The Nowhere News
- 31 Great Wordpress jQuery Resources | Pingable :: Everything Wordpress
- 31 Great WordPress jQuery Resources | The Designer's Pod
- 35 Stylish And Modern WordPress Plugins Using jQuery UI « DownGraf – Your Graphic World
- 20+ jQuery and Wordpress Tutorials – A Match Made in Heaven
- WordPress and Jquery Plugins | www.eqloud.com
- 20 Stylish WordPress Plugins Using jQuery UI
- 35 Stylish And Modern WordPress Plugins Using jQuery UI « Downgraf – Design weblog for designers
- Top jQuery WordPress Tutorials and Plugins - DesignModo
- 30 Tutorials Combining Both WordPress and jQuery | a place to share, bookmarks, resources, css, jquery, photoshop, design, inspiration
- Top Wordpress jQuery Plugins-Nihad Nagi
- 16 Useful jQuery Tutorials to Enhance your WordPress Site
- 16 Useful jQuery Tutorials to Enhance your WordPress Site | WPhub.biz
- Pin Board » Using jQuery to liven up your WordPress login – The WordPress Guru
- Top jQuery WordPress Tutorials and Plugins



How about the HTML for the SIGN-UP form?
Can you give a snippet like the login form?
thanks… Tal!
Now Internet radio is shaping up as competition for digital audio players by providing free online music streaming from websites such as Pandora and Spotify.
Singer-songwriter Theresa Andersson had just wrapped up a set at the New Orleans Jazz and Heritage Festival, and new fan Dana Spanierman was already planning how she could hear similar bluesy harmonies.
“I’m going to put her into Pandora and see who else I’ve been missing,” the Santa Cruz, California resident said.
Spanierman is one of 125 million registered users of Pandora Media Inc P.N., a service that lets listeners create their own playlists, or “stations.”
Using a single genre, artist or song title that users type into an app downloaded to their computer or smart phone, it compiles and streams songs by a variety of artists who share musical attributes with the one requested.
“It’s a great way of putting in a genre that I like and hearing other bands that I’m not that familiar with,” Spanierman said.
Pandora produces these customized playlists by using technology from the Music Genome Project, an intensive analysis and cataloging of music based on some 450 distinct markers related to tonal quality, rhythm, instruments and style.
The publicly traded company has close to a million songs in its database and streams the music free of charge to listeners, which for Spanierman – who hates paying for music – is a big plus. “It really works for me. I don’t even really mind the commercials,” she said, touching on Pandora’s primary revenue stream.
You might be interested in:Pandora Charms