wordpress snippets last updated   : August 18, 2014
we now have 638 snippets

Display content based on user capability

wordpress snippet

Adding the first snippet to the functions.php of your wordpress will let you display content base on user capability. Use the second snippet in your posts with the corresponding capability. View the codex for more information on capabilities Great little snippet By Justin Tadlock.

read more

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

User controlled optional wordpress login redirect

wordpress snippet

Do you require a more complex way to redirect users around your website when they login. This is a great method to use if you want to give your subscribers the ability to choose the page they are redirected to. You could provide visitors the option to redirect directly to their profile page or a custom settings page for your wordpress site. Adding this snippet to the functions.php of your wordpress theme will add a select menu to the login screen that will allow your users to choose where they would like to be redirected.

If redirecting based on role or capabilities is more your style take a look at this snippet.

read more

Add total members to “Right Now” dashboard widget

wordpress snippet

Great little snippet that will display the total number of members within the Right now dashboard widget. Just add this to the functions.php of your wordpress theme and you are ready to go.

read more

Display custom message on the user registration page

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will display a custom message on the user registration screen.

read more

Redirect user after login

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will redirect the user to your homepage after they login.

read more
jqsnipp.com | we just launched jquery snippets website