wordpress snippets last updated   : August 18, 2014
we now have 638 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

Add a custom class to the_tags

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will add a custom class to links output by the_tags template tag.

read more

Add a custom class to wp_get_attachment_link

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will add a custom class to wp_get_attachment_link.

read more

Add post class to posts with read more link

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will add a post class to posts that contain a read more link.

read more

Remove every class and id from the wp_nav_menu

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will remove nearly every class and id from the wp_nav_menu except for the current-menu-item class. This is a great little snippet that will make your wp_nav_menu a little cleaner enjoy.

read more

Add custom body_class to all post and pages

wordpress snippet

This is similar to another body_class post I made however I had a few emails asking about just adding a specific class to the body on every page. Adding this snippet to the functions.php of your wordpress theme will let you add specific classes to wordpress body_class function. Don’t forget to add <?php body_class(); ?> to the body tag within header.php.

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