This topic has 3 replies, 2 voices, and was last updated 7 years, 2 months ago ago by Rose Tyler
Hi
Could you advise on how to target the category, category product and product pages.
I am using a child theme to add banner images 100% full width under the header and above the breadcrumbs. I have created a new template to add this and I am pulling the category image for the banner from the category thumbnail.
I will add a static image for all product pages but would like to add an if statement to place the applicable code on the applicable page.
So far i have this just for the category page:
<?php if ( is_page_template( ‘content-product_cat.php’ ) ) {; ?>
<section>
<div class=”full-width”>
<div class=”header-image” data-stellar-ratio=”0.85″ style=”position:relative; display:block !important; overflow:hidden;”>
<?php do_action( ‘woocommerce_archive_description’ ); ?><!– This will place the category thimbnail as the header image –>
</div>
</div>
</section>
<?php } else { ?>
<!–nothing happens–>
<?php } ?>
this is not working it is just showing the else statement.
Is there a way to target each page e.g..
if category page (show this) and if product page (show this)?
Thanks
I’ve found the conditional tags for woo commerce pages.
https://docs.woocommerce.com/document/conditional-tags/
Hello,
Is your issue solved?
Regards
You must be logged in to reply to this topic.Log in/Sign up