Custom post type returns bad post ID

Use the following before $post->ID in your code:

global $post

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