Skip to main content
Participant
April 17, 2017
Answered

Wordpress Theme editing issue

  • April 17, 2017
  • 4 replies
  • 972 views

I am having a problem editing wordpress themes in dreamweaver.  it is giving me the following error:

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

instead of showing the information on the index page of the theme.  Not the top level index page shows the correct information (ie what is in my local version of wordpress).

This is on a local install of wordpress.  I saw suggestions of disabling permalinks.  but I can't find disable as a choice.

    This topic has been closed for replies.
    Correct answer thatsmauri

    dohertydan,

    viewing the index.php of the theme will always throw this error, no matter what you try. That's how it works.

    To see any changes that you have made to your theme, you'll need to visit your website's main site.

    This blog entry from another site might help:

    » How to fix the “PHP Fatal error: Call to undefined function get_header()” error in WordPress | Ardamis

    Kind Regards,
    Maurice

    4 replies

    January 6, 2021

    I am also facing the same issue [URL removed by moderator].

    [Moderator Note: Potential spam backlink removed.

    Please start a new conversation if you are having difficulty, rather than piggybacking on this answered post from 2017.

    Be sure to include pertinent information like your OS and DW versions and what, specifically, you are having issue with. This post is locked.]

    Nancy OShea
    Community Expert
    Community Expert
    April 17, 2017
    Nancy O'Shea— Product User & Community Expert
    thatsmauri
    Community Expert
    thatsmauriCommunity ExpertCorrect answer
    Community Expert
    April 17, 2017

    dohertydan,

    viewing the index.php of the theme will always throw this error, no matter what you try. That's how it works.

    To see any changes that you have made to your theme, you'll need to visit your website's main site.

    This blog entry from another site might help:

    » How to fix the “PHP Fatal error: Call to undefined function get_header()” error in WordPress | Ardamis

    Kind Regards,
    Maurice

    Participant
    April 17, 2017

    thank you Maurice and Nancy!

    Rob Hecker2
    Legend
    April 17, 2017

    OK, so if you run wordpress on your local machine, can you do it by simply entering localhost in a browser? If not, then what is the url you use to run it locally?

    When EXACTLY do you get the fatal error? When you are running the site from DW?

    The get_header() function is a basic part of the wordpress structure. you can comment it out by putting two forward slashes in front of the function call, but eventually you will need it to run in order to view your edited theme correctly.