Title: xanthi00's Replies | WordPress.org

---

# xanthi00

  [  ](https://wordpress.org/support/users/xanthi00/)

 *   [Profile](https://wordpress.org/support/users/xanthi00/)
 *   [Topics Started](https://wordpress.org/support/users/xanthi00/topics/)
 *   [Replies Created](https://wordpress.org/support/users/xanthi00/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/xanthi00/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/xanthi00/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/xanthi00/engagements/)
 *   [Favorites](https://wordpress.org/support/users/xanthi00/favorites/)

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [PHP Fatal error: Call to undefined function get_header()](https://wordpress.org/support/topic/php-fatal-error-call-to-undefined-function-get_header-1/)
 *  Thread Starter [xanthi00](https://wordpress.org/support/users/xanthi00/)
 * (@xanthi00)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/php-fatal-error-call-to-undefined-function-get_header-1/#post-3430469)
 * There is a header.php for the theme and it is present in the theme folder. Still
   no closer to finding the cause of this.
 * I’ve done some more testing, and I don’t get the error when viewing the dashboard
   or when using a different theme. Further, disabling all widgets doesn’t help 
   so it’s definitely a theme problem.
 * The question is – where and what?
 * Checking the logs again – if I visit
    [http://***/blog/wp-content/themes/kwpo/index.php](http://***/blog/wp-content/themes/kwpo/index.php)
   directly, I get a 500 browser error and the same message in the log.
 * When I view the blog normally, I get the error as posted in the OP BUT it has
   `
   referer: http://****/blog/` on the end of it.
 * So, it seems for some reason somewhere in the template is trying to call the 
   theme’s index.php directly. Even more strangely, the log file shows the client
   address as my remote IP so the request is from my browser rather than from the
   server.
 * UPDATE:
 * Culprit found. After discovering the above, I figured it must be a separate request
   from the browser causing the error in the logs (since the page renders fine) –
   looking at the console in Chrome I found a “resource not loaded” error (with 
   an HTTP/500 response) – BINGO!
 * Found this line in the header:
 * `<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>" type="text/
   css" media="screen" title="no title" charset="utf-8"/>`
 * Which is trying to load the url
    [http://****/blog/wp-content/themes/kwpo](http://****/blog/wp-content/themes/kwpo)
   as a stylesheet. This is then loading the index.php for the theme directly, and
   of course none of the WP functions are defined when it’s accessed directly hence
   the error in the logs.
 * Checking the theme source, this line is also present in the demo site for the
   theme so it’s just a bug in the theme’s header.php
 * Removing the above line has fixed the problem.

Viewing 1 replies (of 1 total)