updated   : May 15, 2012
we now have 588 snippets
By : , on May 04, 2012 9:20 am

Remove unneeded images / thumbnail sizes

wordpress snippet

Adding some or all of these lines of code to the functions.php of your wordpress theme will effectively remove some of the default images sizes that may be unneeded. Make sure to include both the _w _h for width and height,

read more
By : , on December 21, 2011 9:00 am

Display EXIF metadata in media library admin column

wordpress snippet

For anyone that uses wordpress for photography you should find this snippet useful. Adding this snippet to the functions.php of your wordpress theme will create a new column within the media library that will display EXIF metadata. Including, (credit, camera, focal length, aperture, iso, shutter speed, timestamp, copyright).

read more
By : , on December 12, 2011 9:00 am

Attach images with simple thumbnail selection metabox

wordpress snippet

A little snippet I wrote recently to easily attach images to posts with a simple thumbnail selection metabox. Add the first snippet to the functions.php of your wordress theme. Place the second snippet within the loop of your wordpress theme to display the images in your posts or pages.

read more
By : , on November 25, 2011 9:00 am

Remove p tag from around images in the_content

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will remove the HTML p tag from around images in the_content.

read more
By : , on October 18, 2011 9:00 am

Display screenshot of any website using shortcode

wordpress snippet

Adding the first snippet to the functions.php of your wordpress theme will let you use the bellow shortcode to display a screenshot of any website.

read more
By : , on September 06, 2011 9:00 am

Add rel=”lightbox” to all images embedded in a post

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will add a rel=”lightbox” attribute to all images embedded in your post. Also note that on line 05 you can change the rel=”lightbox” to whatever you need as some image viewer scripts will use rel=”thumbnail” for example. This snippet will also add the post title as the title attribute of the images anchor tag.

read more
By : , on June 27, 2011 9:00 am

Attachment window hide buttons and input fields

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will allow you to hide buttons and input fields within the media attachment window.

read more
By : , on June 26, 2011 9:00 am

Restrict uploads to specified file types only, jpg, gif

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will allow you to restrict uploads to an array of specified mime types only. This sample only allows jpg and gif images, adding a new line for png eg: ‘png’ => ‘image/png’, would then allow png images.

read more