if statement makes two banners appear on category page

Hi, I’m using wordpress and woo commerce and i have a different banner slider on every product page and another on the main category page. I have tried using php to show the banner by id and by product title but it makes no difference, the error is still the same. On the main category page the main category banner shows along with the first product in that category, so two banners on the page. What am i doing wrong, surely by using an if statement that only works by ID, the banner should only work on this ID?

Here is the code:-

[php]

<?php if(is_product_category( 'powders' ) ) { echo do_shortcode('[smartslider2 slider="14"]'); } ?> <?php if(get_the_ID()==78) { echo do_shortcode('[smartslider2 slider="11"]'); } ?> <?php if(get_the_ID()==82) { echo do_shortcode('[smartslider2 slider="12"]'); } ?> <?php if(get_the_ID()==85) { echo do_shortcode('[smartslider2 slider="13"]'); } ?>

[/php]

You write that “the error is still the same”, what exactly is the error…?

Hi Jim, It’s not an actually error message just that I get two banners appearing one below the other when there should only be the banner for the main category. For some reason the banner for the first product in that category appears beneath the main category banner.

Sponsor our Newsletter | Privacy Policy | Terms of Service