WP_Query Custom Post Type if Category ID Equals

Turns out what I needed is to use “in_category” NOT “is_category”.

Here is the solution:

<?php if (in_category(7)) {
    echo 'yes';
} else {
    echo 'no';  
} ?>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)