Title: The php code does not work in header.php file
Last modified: August 30, 2016

---

# The php code does not work in header.php file

 *  Resolved [klmnweb](https://wordpress.org/support/users/klmnweb/)
 * (@klmnweb)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/the-php-code-does-not-work-in-headerphp-file/)
 * Hi,
 * I added your wonderful plugin and used the php code
 * `<?php echo get_avatar( get_the_author_meta( 'ID' ), 96 ); ?>`
 * to fetch this on header.php file. Unfortunately, it does not show up at all. 
   But when I add this in footer.php it does. Why so? Can you please help fix this?
 * Thanks
 * [https://wordpress.org/plugins/avatar-manager/](https://wordpress.org/plugins/avatar-manager/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Cătălin Dogaru](https://wordpress.org/support/users/cdog/)
 * (@cdog)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/the-php-code-does-not-work-in-headerphp-file/#post-6378652)
 * Hi klmnweb,
 * This is how [`get_the_author_meta`](https://codex.wordpress.org/Function_Reference/get_the_author_meta)
   works. If used within [The Loop](https://codex.wordpress.org/The_Loop), the user
   ID doesn’t need to be specified, it defaults to the current post author. A user
   ID must be specified if used outside [The Loop](https://codex.wordpress.org/The_Loop)(
   which is obviously your case). Please let me know if this helps.
 * Best,
    Cătălin

Viewing 1 replies (of 1 total)

The topic ‘The php code does not work in header.php file’ is closed to new replies.

 * ![](https://ps.w.org/avatar-manager/assets/icon-256x256.png?rev=1979607)
 * [Avatar Manager](https://wordpress.org/plugins/avatar-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/avatar-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/avatar-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/avatar-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/avatar-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/avatar-manager/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Cătălin Dogaru](https://wordpress.org/support/users/cdog/)
 * Last activity: [10 years, 8 months ago](https://wordpress.org/support/topic/the-php-code-does-not-work-in-headerphp-file/#post-6378652)
 * Status: resolved