Fatal error: Call to undefined function get_header() in index.php on line 1

abbas picture abbas · Apr 8, 2012 · Viewed 69.8k times · Source

I have the same issue. I am totally new in PHP. I installed XAMPP and downloaded the hatch theme from WordPress. When I run index.php it gives me the following error

"Fatal error: Call to undefined function get_header() in C:\xampp\htdocs\hatch\index.php on line 1"

How can I fix this?

Answer

mrlee picture mrlee · Apr 8, 2012

It appears that you're trying to run a WordPress theme outside of an installation of WordPress.

You need to download a copy of WordPress, extract it into your htdocs folder (like you did with the theme), and then navigate to it in your browser.

After setting it up (just follow the instructions), you need to place that theme in wp-content/themes inside the WordPress install.

Then, you can change the theme to your new one in your WordPress administrator panel.