wordpress snippets last updated   : April 22, 2014
we now have 631 snippets

Add class to first post in the loop

wordpress snippet

If you wanted to add emphasis to the first post in your blog adding this snippet to the functions.php of your wordpress theme will add the class of “first” to your first post.

read more

Microformatted and HTML5 compliant loop

wordpress snippet

Why not replace your existing wordpress loop within your theme to a microformatted and HTML5 compliant loop.

read more

Check for post type within loop using get_post_type

wordpress snippet

Adding this snippet within the loop of your wordpress theme will let you conditionally check for a specific post type. Just change the post type ‘products’ or ‘people’ to the post type you would like.

read more

How to display multiple custom field values

wordpress snippet

Adding this snippet within the loop of your wordpress theme will let you display multiple instances of a custom field value.

read more

Redirect home page to a random blog post

wordpress snippet

This is a slight mod of the wordpress post from yesterday (Redirect home page to first blog post) and think you might enjoy it. Add this snippet to the index.php template of your wordpress theme before get_header(). Your home page will automatically redirect to a random post from your wordpress database.

read more

Redirect home page to first blog post

wordpress snippet

Place this snippet at the top of the index.php template of your wordpress theme before get_header(). Your homepage will then automatically redirect to the first blog post.

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