is_product()WC 1.0

Is_product - Returns true when viewing a single product.

No Hooks.

Return

true|false.

Usage

is_product();

Examples

0

#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() code WC 7.5.1

function is_product() {
	return is_singular( array( 'product' ) );
}