Here we will learn about how to check current page is a product category.
There is two way to check page is a product category.
We will also find categories with certain IDs, slugs, and names.
1. is_product_category():
The WooCommerce product taxonomy is ‘product_cat’.
Let’s see WooCommerce conditional tags.
Examples:
<?php if( is_product_category() ) { // do something here... } else { // do something here... } ?>
It is also possible to pass multiple categories and slugs.
<?php if( is_product_category( array( 3, 5, 9 ) ) ) { // product categories with ID = 3 or 5 or 9 // do something here... } elseif( is_product_category( 'bmw' ) ) { // product categories with slug or title "bmw" // do something here... } else { // do something here... } ?>
2. is_tax( ‘product_cat’ ):
This function is similler like is_product_category().
Examples like same as above:
<?php if( is_tax( 'product_cat', array( 3, 5, 9 ) ) ) { // do something here... } elseif( is_tax( 'product_cat', 'bmw' ) ) { // do something here... } else { // do something here... } ?>
In this article, we have to show Create and Used PIPE in angular
In this article, we have to show Create and Used PIPE in angular
In this article, we have to show Create and Used PIPE in angular