Ads to not appear in woocommerce?

Posted in: Newspaper
Post count: 135

Hello,

Is it possible to have ads not appear in only woocommerce related pages? If so, how do you do this?

THank you.

Post count: 22421

Hi,
It depends on what ads you are referring to? header? footer? sidebar? Please provide more details so I can provide the proper answer.
Thank you!

Post count: 135

Missed this…

I’m referring to the header. Thank you.

Post count: 22421

Hello,

If the header ad is what you are after you can create a condition around the header ad to make it not apply on woocommenrce pages. You can use this function: https://docs.woocommerce.com/wc-apidocs/function-is_woocommerce.html
As an example on header style 1 you can replace this code:
https://www.screencast.com/t/1k2dGIr4w
with this one:
<?php if(!is_woocommerce()){?>
<div class="td-header-sp-recs">
<?php locate_template('parts/header/ads.php', true); ?>
</div><?php } ?>

It should look like this: https://www.screencast.com/t/ZNcTcS7fYWgK

Thank you!

Post count: 135

Bogdan,

As always. Thank you. I really appreciate your time and support!

Viewing 5 posts - 1 through 5 (of 5 total)
The forum ‘Newspaper’ is closed to new topics and replies.