Custom post type functions.php if statement on action

you need a global $post; within that function before trying to access the contents of $post.

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