custom fields not showing before get_header

It seems that at that point, $post is not yet defined, you can make sure by turning debugging on.

Then add this before your get_post_meta( $post...:

global $post;

Or you can replace $post->ID with get_the_ID().

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