in_category() not working in WordPress 4.9.7

You’re using in_category() outside of a loop, so you need to pass the post ID in as the 2nd argument.

eg, if (in_category( 'vid', $post->ID )) {

See Codex.

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