Redirect based on user roles or capabilities
Adding this snippet to the functions.php of your wordpress theme will let you redirect users based on roles or capabilities.
read moreExpire protected post cookie with session
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 moreDisplay avatar for currently logged in user with get_avatar
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 morethis months featured snippets
User controlled optional login redirect
Adding this snippet to the functions.php of your wordpress theme will let user controlled optional login redirect with a select menu.
read moreDisplay a simple login form anywhere with wp_login_form
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 moreRedirect back to referring page after login
Adding this snippet to the functions.php of your wordpress theme will redirect visitors to the page they were viewing after logging in.
read moreAdd a login link to the wp_nav_menu
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 moreChange register text to “Sign Up” on login page
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












