Welcome To Snipplr


Everyone's Recent PHP Snippets Tagged image



use <?php>/images/someimage.gif Such a path resolves to .. http://www.yoursite.com/wp-content/themes/YOURTHEME/images/someimage.gif
0 87 posted 9 years ago by disgruntledillon
Resize and image to fit a predetermined canvas size
0 160 posted 9 years ago by flatearthcomms
Universal WordPress function for thumbnails
0 83 posted 9 years ago by gn_themes
This goes in any phtml file to get the image from the skin folder
0 74 posted 9 years ago by uteman23
0 155 posted 9 years ago by zayyarphone
This is a much cleaner way to do this than the number of examples on the web. Every example I saw seemed to account for orientation - horizontal vs. vertical vs. square when looking at the input. This ignores horizontal and vertical by mapping the...
0 99 posted 9 years ago by dblack
Pull banner ad or image code from a given text file into an array and randomize the order. Banner/image codes in the file should be separated by tildes (~).
0 103 posted 9 years ago by bluecap
2 105 posted 9 years ago by janvdm
2 84 posted 9 years ago by janvdm
The following script will easily allow you to resize images using PHP.
3 118 posted 9 years ago by enkas
#ImageMagick must be installed on server for this operation
6 336 posted 9 years ago by alessio2
If post has featured image, use it.. If not, pick out the first in the post.. Still not working? Stick with the default one..
3 165 posted 9 years ago by Wendelboe
Original custom fields code based on Wefunction's code here: http://wefunction.com/2008/10/tutorial-creating-custom-write-panels-in-wordpress/ enhanced to add support for uploading images.
1 120 posted 9 years ago by simnor
0 81 posted 9 years ago by whak
This code will retrieve the url of a featured image in order to use it as a background.
0 98 posted 9 years ago by jli
This code war written for a project I'm working on where a map of the world may need to be offset to center the view on specific areas. I'm also using it as a part of an iterative blur function to prevent seams from the blur operation. I would lik...
0 97 posted 9 years ago by Jamie
If the optional parameter $crop is set to TRUE the image will be zoomed and cropped to specific size ($new_size). Else, the image will be resized to size, keeping aspect ratio and using $new_size as max size.
0 130 posted 9 years ago by stz184
1 119 posted 9 years ago by rave
I’ve been working on a CMS lately and having to create thumbnails for uploaded images is always a pain, lots of maths working out the correct sizes and such, so I’ve created a fairly small script to manipulate images in an object-oriented style.
0 131 posted 10 years ago by dom111
0 143 posted 10 years ago by wireplay
<img>
1 123 posted 10 years ago by stuntsnippets
* Creates thumbnail from image * thumbnail dimensions can be set as parameters * accepts JPG, JPEG, GIF, PNG * preserves transparency for GIF and PNG on thumbnails * call function like this: createthumb(images/original.jpg, thumbs/thumb.j...
3 112 posted 10 years ago by alessio2
You can use this script in your projects when you need an image upload function. It checks file type, file size and error report. I also want you to check [giochi di spongebob](http://www.giochidispongebob.net) and [gratis mahjong](http://www.gratism...
1 140 posted 10 years ago by jackoder
Just set the variable `$email` to the user's email address. Hey presto! A Gravatar image! You can also change the size by adjusting the `s=32` variable. Size is in pixels.
1 74 posted 10 years ago by JackWH