Why Create a WordPress Login Popup?

If we are running an online store, membership website, or any other website that needs users to login,  a quick access to their admin area it is essential.

Normally, when users click on the login link (see video below), the popup modal will show with the login form.

A modal login popup enables you to display the login form without sending users to a different page. Once logged in, you can redirect users to any page you want.

Step 1 

Create javascript file  add the code below (gist: ajas-login-script.js) and enqueue the script into your wordpress theme.

Step 2

Create a function in your theme’s functions.php with the code below (gist: functions.php).

Step 3 

Display the login URL/Icon when the user is logged in. Add the code below (gist: header.php) to your header.php .