612-293-8629 HELLO@THEMIGHTYMO.COM

I have a site that requires a login to view. Rather than redirect visitors to the home page after login, I thought it would be nice to include a redirect to the current page after login.

It turns out that WordPress handles this quite easily using the following code:

echo '<a href="' . wp_login_url(get_permalink()) . '">Login</a> to view this content.';

I first found the idea from Ashfame, but then I found a better version via WPRecipes.com, which you see above.

PHONE, EMAIL, TEXT

We love to communicate: phone, email, text, Facebook, Twitter, LinkedIn, you name it.

LOCATIONS

PAYMENTS ACCEPTED

Call Now

Enroll in Our Free Beginner WordPress Class - delivered to your Email Inbox!

Become a WordPress superstar for FREE in only minutes a day!  Our free Beginner WordPress Email Class will be delivered to your inbox!

Learn More 

You Have Successfully Enrolled! Prepare For Amazing!