I am trying to use is_category in woocommerce.php which does not work. I want to print the name on the page.
IF the page is a category page, then woocommerce_page_title() is printed, and if the page is a product, then print the_title() .
And the code that I use in woocommerce.php is:
<?php if(is_category()){ ?> <h1 class="page-title"><?php woocommerce_page_title(); ?></h1> <?php } else{ the_title(); } ?>
But in each case, it prints the_title() . I think is_category() does not work for woocommerce.
Or Can anyone tell me how woocommerce does this to print category and product names?
Any help would be appreciated.
source share