wordpress snippets last updated   : April 14, 2014
we now have 630 snippets
category page

Enable Contact form 7 on specified pages only otherwise wp_deregister_script

wordpress snippet

Like many plugins Contact form 7 adds CSS and Javascript to the head of your HTML document. However like many plugins this is done on every single page regardless if the code is required. Adding this snippet to the functions.php of your wordpress theme will let you enable Contact form 7 only on specified pages.

read more

Hide post view and post preview admin buttons

wordpress snippet

Ever wanted to remove “preview & view” options from the new post and post edit admin screens. Add this snippet to the functions.php of your wordpress theme and don’t forget to update the post type array. Enter any post type you would like to remove the “view and preview” buttons from “custom post type, post, page”.

read more

Generate QR Code for posts and pages

wordpress snippet

Have you ever wanted to generate a Quick Response Code / QR code for a post or page of your wordpress website? Simply add this small snippet to the single.php of your wordpress theme in the location you wish to display the QR. To adjust the size of the QR post / page image just change the following within the src size=100×100.

read more

Check if post / page has a gallery

wordpress snippet

Adding this snippet to your wordpress theme will let you check to see if a post contains the gallery shortcode. Add this code to the single.php template of your wordpress theme inside the loop.

read more

No excerpt available, display default message

wordpress snippet

Adding this snippet to your wordpress theme will allow you to display a default message when no excerpt has been added.

read more

Facebook open graph snippet to set default image

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will allow you to specify Facebook Open Graph information on your WordPress posts. Allowing you to specify which image should be displayed when sharing your article on Facebook among other things.

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