WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Call to undefined function get_header()

[Resolved] Call to undefined function get_header()

  • I have been getting the following error for a long time now. I have Googled it on many occasions and I know the standard answer is that your theme is in the wrong place. My site works fine and I have never had this error show for myself, but consistently every day i have hundreds of lines of this error in my error log. My theme is exactly where it should be and there are no theme files in the main directory. What could be causing this and how can I fix it? Clearly the site is functioning and the header IS defined as far as I can tell. The only notable thing I can think of is the fact my WP install is in a directory (/blog) and being run from the main folder.

    The site is here: http://farmvillefanatic.com/

    PHP Fatal error: Call to undefined function get_header() in /home/jakets/public_html/blog/wp-content/themes/exile/index.php on line 1

    Other than this my site runs flawlessly, I would love to fix this. Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator James Huff

    @macmanx

    That’s nothing to be worried about. You’re only seeing this in your error log because some bots and some incredibly lost people are trying to access your site at /blog/wp-content/themes/exile/index.php .

    The error is entirely normal for that location since theme functions are designed to be called from the blog directory, not from the theme directory.

    You can limit the bot access to your theme files by creating a text file titled robots.txt in your main directory with the following content:

    User-agent: *
    Disallow: /blog/wp-content/themes/

    Thanks! I downloaded and installed PC Robots.txt and modified it slightly (adding /blog in front of each). It actually had a bunch of locations to disallow already in it for other areas of the blog that I get some errors for. I appreciate the help, I was starting to worry about getting that error so often, hopefully this will take care of it. 🙂

    Moderator James Huff

    @macmanx

    You’re welcome!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Call to undefined function get_header()’ is closed to new replies.
Skip to toolbar