Welcome To Snipplr
Everyone's Recent PHP Snippets Tagged image
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Add an image to the email, must be linked not embedded ie in thunderbird mail moz-do-not-send attribute must be set true.
any requests for this gif image will be redirected through display which will log the request and serve up the stored t.gif i...
0
1018
posted 10 years ago by stiva71
Sometimes you may need to change image properties 'on-the-fly'. The best example is when you want to display blog post short description, retrieve the first image and try to turn it into the thumbnail: change some properties and add a special class n...
0
976
posted 10 years ago by apphp-snippets
I find myself needing to constantly find new ways to massage the featured image via WordPress themes. This is my starting code. Note: I often use timthumb.
2
1003
posted 11 years ago by FlashBuddy
To insert custom loop of post attachments as images (at core or custom size) linked not to full size image but custom-configured (or core) size.
2
1044
posted 11 years ago by adambundy
Returns array with information like:
Input image
width 200
height 200
print_r(ratioResize('path/to/image.ext' , 100 , 50));
output:
array(
[ratio] => .5,
[height] => 50,
[width] => 50,...
0
899
posted 11 years ago by ShawnG
This is my simple image resizer on the fly thing.
-- WARNING --
Resizing and showing images on the fly could potentially kill your server or make the website slow.
Ideally, this should save the resized image in a cache. However, more often th...
0
1194
posted 11 years ago by brownrl
**Example of use:**
echo base64DataUri('/var/www/html/background.png');
*or*
echo base64DataUri('http://static.php.net/www.php.net/images/php.gif');
0
746
posted 11 years ago by phpdev
**Example of use:**
<a href="http://www.php.net/manual/en/index.php"><img src="<?php echo get_favicon('http://www.php.net/manual/en/index.php') ?>" alt="Favicon" title="See PHP documentation" width="16" height="16" /></a>
0
1521
posted 11 years ago by phpdev
simple image rotation script; save as rotate.php in folder with images, call <img> to display
0
1051
posted 11 years ago by goddess
This is some code using Thematic Child Theme overrides to remove thematic's post thumbnails and add Post Thumbnails outside of the .entry-content <div> so that POst Thumbnails can be styled separated from all post Meta. See this page for an example...
0
851
posted 11 years ago by AndrewThinkUp
A function to upload an image to the media library and set it as featured image of a post. It requires 2 params. The name of the upload field and of course the post ID.
This function is part of the WPelements library class available on Github. Fee...
0
1186
posted 12 years ago by krike
AL subir imagen png, se deben pasar al directorio con transparencia
0
1014
posted 12 years ago by thescorpion
AL subir imagen png, se deben pasar al directorio con transparencia
0
1148
posted 12 years ago by thescorpion
Just a rework of http://snipplr.com/view/7523/ with an added switch to change type number to extention name.
0
1152
posted 12 years ago by Some0ne
This snippet will exclude the featured image from the attached images (gallery)
0
696
posted 12 years ago by nerdsane
UPDATE: might be easier or faster to use this now (also courtesy Pippin): http://pippinsplugins.com/get-all-attached-media/
**courtesy Pippin Williamson (http://pippinsplugins.com/image-gallery-short-code-using-post-attachments/)
use shortcode...
1
961
posted 12 years ago by adambundy
The admin pages listing the site’s posts and pages come with various text columns (title, tags, categories, author and so on). In order to see what the featured images are, you have to visit each post or page individually. What I will show here, is...
0
885
posted 13 years ago by i-am-andy
Add or Change Content in the Featured Image Meta Box
Posted on March 21, 2011
Perhaps you need to provide a little extra instruction about the Featured Image meta box. It doesn’t take much to add your own text to that box:
0
914
posted 13 years ago by i-am-andy
<?php> will random load images named (in this example) image_1.jpg up to image_5.jpg
0
915
posted 13 years ago by DeluxiveState
Using the ID of a page, you can get the content, the featured image and the title to power widgets in your template.
0
758
posted 13 years ago by mejamiewilson
A function that resizes an image to desired width and height, but does not distort the image proportions. Works for JPEG, GIF and PNG.
0
1004
posted 13 years ago by TimoZachi
Simple call imageExists('http://example.com/image.jpg');
true if it exists else false.
0
950
posted 13 years ago by MichaelM
used as so
<style>
.logo {
background: url("<?php>") no-repeat right 5px;
}
</style>
or
<img src="<?php>"/>
0
878
posted 13 years ago by alyssonweb