Conditional Statement custom post type category

I would like to display a text depends of my custom taxonomy category, like:

if custom post type category is X, then echo Text Y.

I’ve tried this, but its not working:

global $post; 
if (($post->post_type == 'myposttype') && is _category('slug-name-of-cat')) {
 echo 'My text'

 }

any ideias?

Read more here: Conditional Statement custom post type category

Leave a Reply

Your email address will not be published. Required fields are marked *