Check Page Single Of Custom Post Type
this article I will guide you to test yourself in the custom post type single platform or not, this is used when you make sales in the widget page I want to display various widgets …
you copy paste the following code into the functions.php file offline
function wpr_is_post_type($type){
global $wp_query;
if($type == get_post_type($wp_query->post->ID)) return true;
return false;
}
then you put the code wpr_is_post_type ($ type) on the condition that you want to display, replace $type in the name of custom post type that you create in your theme
eg wpr_is_post_type (“products”)