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

Add a Class to ‘the_post_thumbnail’ a Featured Image

wordpress snippet

When adding a featured image to a template, you may want to add a class to the image tag that is being generated. This extra class will allow you to use CSS to format it better.

read more

Redirect a successful registration to specific page

wordpress snippet

When you allow user registration on our wordpress site you may want to add something extra. Interested in thanking people after they register or just send them to a specific page for newly registered members.

read more

Remove wordpress login shake effect when error occurs

wordpress snippet

Have you ever been annoyed by the login error shake? As if the shaking is mocking you every time you enter the incorrect username or password. Ya me neither but if you do wish to remove the shake after a login error add the following snippet to the functions.php of your wordpress theme.

read more

Upload user-submitted files from the frontend

wordpress snippet

There are many use cases for allowing users to upload files from the frontend, but the trick is making sure the file is uploaded and saved in the WordPress media library correctly. You can easily use standard PHP functions to handle the upload and then store the file wherever you like, but then you won’t be able to take advantage of the attachment system that WordPress uses. An image that is uploaded correctly, for example, will have all the various sizes available as well as the meta data, such as title, description and caption. You will also be able to edit all of this from the media library in your WordPress dashboard.

read more

Add wordpress post types to the dashboard ‘At a glance’ widget

wordpress snippet

The WordPress dashboard includes a handy widget that displays some brief information about your site at a glance – rather creatively, it’s titled ’At a Glance’. By default it shows you the number of posts, pages and comments on your site allowing you to click through to edit each of those sections if you have the right permissions.

read more

Navigate next, previous adjacent post with jquery and the left, right keys

wordpress snippet

If you are using adjacent post relational links in the head of your wordpress theme add this little bit of jquery. This will let people navigate next, previous adjacent post with the left and right arrow keys.

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