How to use get_post_custom function on the blog page?
The basic problem is that there is no variable $post in your header.php. That variable might exist in the global scope, but your code operates in a function scope of load_template() which was called by get_header(). So you have four options: Import the global variable into your function with the global keyword. global $post; // … Read more