pngfix Wordpress Plugin
This plugin uses CSS technique to fix the png image transparency issue and jQuery to apply this script to all of png images shown in the page. The CSS code added by the script is :
background-image: expression(
this.runtimeStyle.filter = “progid:DXImageTransform.Microsoft.AlphaImageLoader(src=” + (this.tagName==\‘IMG\’ ? this[\'src\'] : this.currentStyle[\'backgroundImage\'].split(\’\”\’)[1]) + ")",
this.runtimeStyle.backgroundImage = "none",
this.src = "{plugindir}/pixel.gif",
this.width = this.style.width | this.clientWidth,
this.height = this.style.height | this.clientHeight
);
}’;
And the jQuery code which applies this css to all of the png images :
if(($.browser.msie)&(parseInt($.browser.version)<7)){
$(“img[src$='.png']“).each(function(){$(this).addClass(“png”);});
}
});
That’s all. The jQuery library is included in the plugin so you don’t need to modify anything.
Installation is simple. Just follow these steps :
- Upload ‘wp-pngfix’ directory to the ‘/wp-content/plugins/’ directory
- Activate the plugin through the ‘Plugins’ menu in WordPress
- Thats all. Go to any page which contains some png images with IE and check if there’s any errors.
This should fix them all except backgrounds now.
Download: Official WordPress plugin page : http://wordpress.org/extend/plugins/wp-pngfix/
Note: This type of fixes cause slight color changes to your png images with background color, so you may have to change some css.If you use images without inner backgrounds and only need to show the background transparent, forget that note
People who looked at this item also looked at…
Related items

subscribe to our feed
























April 12th, 2009 at 09:28
Is it compatible with wordpress 2.7.1 ? Please help…
March 27th, 2009 at 01:05
heres the link
March 27th, 2009 at 01:03
I installed your code for a png hack and at the top of the page on IE 6 I there is excessivel code ” ‘; ?>” (without the quotes)
On the most recent safari I see ‘; ?>
I have been trying to get these hacks out for a while and have had no luck. Any help would be appreciated
February 10th, 2009 at 20:31
Another solution that I found to work, is to add “jQuery.noConflict();” at the beginning of the pngfix.php’s javascript code (right before “jQuery(function($){”).
January 25th, 2009 at 14:29
Voya : Thank you
I’ll try that
January 13th, 2009 at 23:21
Hey kardasi! This might be useful, i will test it out later!
Just a note - use javascript without noscript to handle this : If you wish to donate, you can click one of the google ads - it’s against google policy, if they find out that, they will ban you.
try this instead ( since google can’t read JS, or use an image! )
document.write ( “If you wish to donate, you can click one of the google ads “);
cheers
December 4th, 2008 at 04:27
[...] 4. PNG-24 FIX [...]
November 7th, 2008 at 01:07
getting closer…
change source attribute of line 31 of pngfix.php to:
November 7th, 2008 at 01:06
Let’s try that again…
change line 31 of pngfix.php to:
November 7th, 2008 at 01:04
Plugin conflicts with my other jQuery.
edit pngfix.php, line 31:
`’;`
to
`’;`
November 1st, 2008 at 16:46
[...] WP pngfix- This plugin uses CSS technique to fix the png image transparency issue and jQuery to apply this [...]
October 31st, 2008 at 20:58
[...] WP pngfix- This plugin uses CSS technique to fix the png image transparency issue and jQuery to apply this [...]
September 19th, 2008 at 08:25
[...] from here 15) WP pngfix- This plugin uses CSS technique to fix the png image transparency issue and jQuery to apply this [...]
June 22nd, 2008 at 06:41
[...] Taha Paksu desenvolveu o pngfix, um plugin para corrigir o problema do Internet Explorer 6 com transparência em figuras PNG usando [...]
June 20th, 2008 at 00:39
thanks for the help taha paksu, but i can’t improve your plugin with the lightbox.. i give up and finally i put gif instead the pngs.
good luck with the plugin! works perfects except with lightbox!
June 20th, 2008 at 00:10
@José Luís: I found them here http://www.adiumxtras.com/index.php?a=search&cat_id=2 its named Simple Smilies as you can see on the list. And thanks.
June 19th, 2008 at 23:39
Nice plugin! What a shame I only found it now… I had so many troubles with PNG transparency due to IE6…
But I think there is something I can ask you (allthough it’s a little off-topic…)
What is your set of smilies? Where did you get it? Can you send me it or, at least, its URL?
Thanks in advance.
June 19th, 2008 at 20:01
@ponche: yes but you need to edit the code.
Well do it like this :
1) find the line starts with “echo” and delete below it. And then write “}?>” to the end. without the quotes.
2)then find the images you wish to fix and then;
a. if you know html, add ” class=’png’ ” inside the img tag.
b. if you are using the editor in your admin page, then open the image properties dialog about the image you want to fix, and then add the png word into the class field.
then it should work i think.
June 19th, 2008 at 19:52
… i need to fix a couple of images on only one page. it’s posible to select wich pages get the code?
June 19th, 2008 at 19:47
@Taha Paksu:
same problem with new release (2008-6-19).. the fix works perfect but lightbox only appears when I desactivate PNG fix.