if want if condition if is in single page and single post type is product in wpis_singular
The is_singular() function is a conditional tag in WordPress that checks if the current page is a singular post type (such as a single post, page, or attachment).
To check if the current page is a single post type and the post type is "product", you can use the following if condition:
if ( is_singular() && 'product' == get_post_type() ) {
// Code to be executed if the condition is true
}
This code will only execute the code block if the current page is a singular post type and the post type is "product"
原文地址: http://www.cveoy.top/t/topic/iBZc 著作权归作者所有。请勿转载和采集!