is_product()
Is_product - Returns true when viewing a single product.
Uses: is_singular()
No Hooks.
Return
true|false
.
Usage
is_product();
Examples
#1 Check if the current page is the product page.
if ( is_product() ) { echo 'This is the product page'; } else { echo 'This is any other page'; }
is_product() is product code WC 8.6.1
function is_product() { return is_singular( array( 'product' ) ); }