wordpress snippets last updated   : October 6, 2014
we now have 641 snippets

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

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

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

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

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

Remove all images from the_content in a post

wordpress snippet

Adding this snippet to your wordpress template index.php replacing the default the_content(); will remove images from the post. This is a great snippet if you want to display a number of images on single.php but not on the main blog view. Keep in mind that this will not remove the captions so don’t insert the images with a caption or disable all captions.

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