having same issue, i am totally new in php. i install XAMPP then download hatch theme from wordpress. when i run index.php its gives me following error
"Fatal error: Call to undefined function get_header() in C:\xampp\htdocs\hatch\index.php on line 1"
can anyone help about this. Thanks
It appears that you're trying to run a Wordpress theme outside of an installation of Wordpress.
What you need to do is 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 admin panel.
You are doing is just accessing the theme file.That's the reason for the error.
First you need to include the theme file you downloaded into the WordPress installation folder :
wp-content/themes
.
Then activate the theme from the admin dashboard. Then you can use the theme.
You are trying to access the theme file directly from the XAMPP'S htdocs folder. Copy the theme file and add it to htdocs\wordpress\wp-content\themes then run wordpress and add the theme from the admin dashboard.
来源:https://stackoverflow.com/questions/10062717/fatal-error-call-to-undefined-function-get-header-in-index-php-on-line-1