How to stop broken images

Hi,

I have set up some custom fields on my site (wp) and in the product listing page I have 30 products all set up like

Template code:

http://www.leehughes.co.uk/listings.txt

But if i have pages with 14 items then I will have 16 broken images (like the screenshot) left over… is there a way using php to know how many products that page will have so it won’t go over?

In php pseudo code

if(count =< number of images) {
    // echo image html
} else {
    // don't echo image html
}

Hi, thanks for the reply,

Sorry i’m no good with php, where would I add this to my template?

Thanks again :slight_smile:

Everywhere where you output image html. But if you don’t know php I’d suggest you get in touch with the guy who did the template.