WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Call to undefined function get_header() (4 posts)

  1. Jakets
    Member
    Posted 4 years ago #

    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!

  2. 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/
  3. Jakets
    Member
    Posted 4 years ago #

    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. :)

  4. You're welcome!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.