updated   : May 15, 2012
we now have 588 snippets
category login
By : , on February 15, 2012 9:00 am

Redirect based on user roles or capabilities

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will let you redirect users based on roles or capabilities.

read more
By : , on October 20, 2011 9:00 am

Expire protected post cookie with session

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme with a time of 0 in setcookie() forces the cookie to expire with the session. Great little snippet by Drew Jaynes thanks for submitting.

read more
By : , on October 07, 2011 9:00 am

Display avatar for currently logged in user with get_avatar

wordpress snippet

Adding this snippet to your wordpress template will display the currently logged in users avatar in your theme. To adjust the side of the avatar change the number 64 within the get_avatar function default is 96 and max size is 512.

read more
By : , on September 05, 2011 9:00 am

User controlled optional login redirect

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will let user controlled optional login redirect with a select menu.

read more
By : , on September 03, 2011 9:00 am

Display a simple login form anywhere with wp_login_form

wordpress snippet

Adding this snippet to your wordpress theme will display the login form. This is a great snippet if you want to display the login form in an unusual place within your template.

read more
By : , on August 25, 2011 9:00 am

Redirect back to referring page after login

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will redirect visitors to the page they were viewing after logging in.

read more
By : , on July 28, 2011 9:00 am

Add a login link to the wp_nav_menu

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will add a login link to your wp_nav_menu or if the user is already logged in a logout link.

read more
By : , on July 10, 2011 9:00 am

Change register text to “Sign Up” on login page

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will change instances of “Register” to “Sign Up” on your login / register page.

read more