• Hello, all!

    Another fatal error message and I can’t figure out how to solve it!

    I just downloaded XAMPP and WordPress. I put the WordPress folder under /htdocs. I was trying my own theme I’m creating and received the Call to undefined function get_header() error.

    So, I thought I’d try the free themes that comes with WP and sure enough, the same error occurs when I try to open any of them:

    Fatal error: Call to undefined function get_header() in C:\xampp\htdocs\wordpress\wp-content\themes\twentysixteen\index.php on line 17

    This is driving me nuts and I need to get it working so that I can locally develop and design a site for someone!

    Any ideas?

    Thank you.

Viewing 12 replies - 1 through 12 (of 12 total)
  • Hi again rg, no problem,

    A personal advice: never use local xammp or wamp if you can use a webserver. This error is 99% caused by local setup. Please put the server on a shared server or a kind of free host if really low, and i bet hmm will work.

    Thread Starter rgwhitaker

    (@rgwhitaker)

    Then what’s the purpose of XAMPP if you can’t use it!?

    I just want to develop and edit–OFFLINE–a simple WordPress blog.

    Moderator keesiemeijer

    (@keesiemeijer)

    It seems some files are missing from your WordPress install. Download WordPress again and copy all files & folders (except the wp-content folder) to the \htdocs\wordpress folder.

    Thread Starter rgwhitaker

    (@rgwhitaker)

    I’ll try that. But I find it odd that NONE of the free themes that come with WP 4.4 (twentysixteen, twentyfifteen, twentyfourteen) work when I try to access them.

    And just to let you know, I’m starting the XAMPP control panel, then starting Apache and MySQL.

    I then go into my browser and enter the following:

    http://localhost/wordpress/wp-content/themes/twentysixteen/

    Then the error appears.

    I tried it with twentyfifteen and twentyfourteen with the same results.

    Moderator keesiemeijer

    (@keesiemeijer)

    Most theme’s use the get_header() function it their theme template files.
    As it’s also usually one of the first WordPress functions to be called from a theme. It’s odd, but possible the default theme’s show the same error

    Thread Starter rgwhitaker

    (@rgwhitaker)

    OK. But the question is WHY? And how can I resolve it so that I can develop and design a WordPress theme locally?

    Moderator keesiemeijer

    (@keesiemeijer)

    Did you re-upload the files?

    Thread Starter rgwhitaker

    (@rgwhitaker)

    Yes. I re-uploaded the WP files and still the same.

    Let me make sure I’m doing this correctly:

    1. I downloaded the WP .zip file to my hard drive. It was version 4.4

    2. I then extracted all the files to a unique folder

    3. I then copied those files to the /htdocs/wordpress/ folder on my hard drive.

    Is that the correct way to do it?

    I’m still having the same problem. I’ve noticed tons of resolutions, but none of them seem to help me with my situation. I’m also running XAMPP 5.6.15, if that makes a difference.

    Hey, @rgwhitaker!

    I then go into my browser and enter the following:

    http://localhost/wordpress/wp-content/themes/twentysixteen/

    Then the error appears.

    That’s exactly what should be happening. 🙂

    Theme files aren’t meant to be loaded directly in your browser at all; they simply don’t work that way, so that’s why you’re seeing fatal errors when you try to do that.

    IF you want to try out a specific theme, then what you’d do is install it, then go to Appearance → Themes in your WordPress admin and activate it; and once you do that, you’ll be able to see the theme “working” when you visit your site.

    Moderator keesiemeijer

    (@keesiemeijer)

    @girlieworks
    Aha, yes, that’s it (I think). Good catch.

    @rgwhitaker
    What did you expect to see when going to the theme directory?

    http://localhost/wordpress/wp-content/themes/twentysixteen/

    Thread Starter rgwhitaker

    (@rgwhitaker)

    Did that, still get the error.

    Also, I just decided to stop wasting time with XAMPP. I need to move on and get this done!

    So, I uploaded to the server and try to access the theme within the Appearance tab in the WP admin.

    Here’s what’s at the bottom:

    Broken Themes

    The following themes are installed but incomplete. Themes must have a stylesheet and a template.
    Name Description
    eztile/css Template is missing. Delete

    SO NOW WHAT???

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Fatal Error: Call to undefined function get_header()’ is closed to new replies.