In WordPress, you can use the is_page() function to check if the current page is a single page, and the get_post_type() function to check if the current post type is "product". Here's an example of how you can use these functions in an if condition:

if (is_page() && get_post_type() == 'product') {
    // Your code here
}

You can place this code in your theme's template files or inside a custom function in your theme's functions.php file.

if want if condition if is in single page and single post type is product in wp

原文地址: https://www.cveoy.top/t/topic/iBZa 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录