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 561 posted 12 years ago by disgruntledillon
Resize and image to fit a predetermined canvas size
0 824 posted 12 years ago by flatearthcomms
Universal WordPress function for thumbnails
0 461 posted 12 years ago by gn_themes
This goes in any phtml file to get the image from the skin folder
0 500 posted 12 years ago by uteman23
0 722 posted 12 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 571 posted 12 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 658 posted 13 years ago by bluecap
2 578 posted 13 years ago by janvdm
2 525 posted 13 years ago by janvdm
The following script will easily allow you to resize images using PHP.
3 654 posted 13 years ago by enkas
#ImageMagick must be installed on server for this operation
6 1565 posted 13 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 854 posted 13 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 630 posted 13 years ago by simnor
0 558 posted 13 years ago by whak
This code will retrieve the url of a featured image in order to use it as a background.
0 592 posted 13 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 624 posted 13 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 641 posted 13 years ago by stz184
1 763 posted 13 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 550 posted 13 years ago by dom111
0 737 posted 13 years ago by wireplay
<img>
1 732 posted 13 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 655 posted 13 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 723 posted 13 years ago by jackoder
0 545 posted 13 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 413 posted 13 years ago by JackWH