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 835 posted 13 years ago by disgruntledillon
Resize and image to fit a predetermined canvas size
0 1230 posted 13 years ago by flatearthcomms
Universal WordPress function for thumbnails
0 700 posted 13 years ago by gn_themes
This goes in any phtml file to get the image from the skin folder
0 763 posted 13 years ago by uteman23
0 1043 posted 13 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 891 posted 14 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 940 posted 14 years ago by bluecap
2 867 posted 14 years ago by janvdm
2 763 posted 14 years ago by janvdm
The following script will easily allow you to resize images using PHP.
3 978 posted 14 years ago by enkas
#ImageMagick must be installed on server for this operation
6 1981 posted 14 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 1146 posted 14 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 937 posted 14 years ago by simnor
1 1054 posted 14 years ago by hamsterbacke82
0 860 posted 14 years ago by whak
This code will retrieve the url of a featured image in order to use it as a background.
0 861 posted 14 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 962 posted 14 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 943 posted 14 years ago by stz184
1 1061 posted 14 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 843 posted 14 years ago by dom111
0 1059 posted 14 years ago by wireplay
<img>
1 1086 posted 14 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 953 posted 14 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 979 posted 14 years ago by jackoder
0 824 posted 14 years ago by metoikos
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 660 posted 14 years ago by JackWH