Insert specific information to a posts of a predefined category

You shouldn’t inject postinfo() in the <head> section (that’s what happens when you use the wp_head hook).

If you do not want to edit templates, I’d suggest you use the wp_footer hook instead, and append the postinfo to your header div with jQuery, e.g.:

$('.post-info').appendTo('#header');

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