Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

image link to download zip problems WordPress

  • SOLVED

Hello, this might be really obvious.

I have an image on my blog, which i have linked to download a zip file.
all my code is correct and it works on another blog ive tested it out.

but something is interfearing with it on my blog, maybe the theme or fancy box i thought but i turned that off.

i think its something in the php that is blocking the link to download the zip....
i want to maintain my fancybox settings....

this is my site.

http://www.blog.davidsidhom.com/

so for my new post i want to be able to click to download a zip just for this one post but maintain fancy box on the rest of the posts....

hope that makes sence!

Answers (3)

2010-12-21

rilwis answers:

I found that your plugin "Fancybox for WordPress" adds class="fancybox" and rel="fancybox" to a tags which have image inside.

To keep your Fancybox settings, I wrote a snippet of jQuery to remove these attributes, so the download links work while maintaining fancybox effect on other images.

Put these code in your footer (or header either):

jQuery(document).ready(function($){
$('a.fancybox').each(function(){
var $this = $(this), download;
download = $this.attr('href').indexOf('.zip') != -1 ? true : false;
if (download) {
$this.removeClass('fancybox').attr('rel', '');
}
});
});


davidsidhom comments:

it doesnt work i put it in the header and footer, where should i place it? could be that im placing it wrong?


rilwis comments:

May I have FTP access to your site? Send it to my email: [email protected]

2010-12-21

Chris Bavota answers:

Instead of using an actual image tag for your link, you can just use an anchor tag and then style it with CSS.

This is the HTML.

<a href="link-to-zip-file" id="zip-image"></a>

This is the CSS.

#zip-image {
background: url(http://www.blog.davidsidhom.com/wp-content/uploads/2010/12/FREENESS1.png) no-repeat;
width: 615px;
height: 615px;
display: block;
}

2010-12-21

Sarbartha Das answers:

A very Nice jQuery.popeye 2.0 (http://dev.herr-schuessler.de/jquery/popeye/index.html) would be good and best replacement of your current modal box and will solve the problem. There is a Wordpress plug-in (wp-popeye) also on that script.