Title: call to undefined function get_header() LOCALHOST
Last modified: August 21, 2016

---

# call to undefined function get_header() LOCALHOST

 *  [adminadminadmin](https://wordpress.org/support/users/adminadminadmin/)
 * (@adminadminadmin)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/call-to-undefined-function-get_header-localhost/)
 * I have been trying to solve this problem and checking the forums to find solutions,
   but even if sometimes the problem has been solved, I have no clue. I am using
   XAMPP to work with the localhost. I am using a customized template. I have siteurl
   and home links set in DB in phpmyadmin correctly for the localhost. I can see
   the main page of my site perfectly. However, the links from the website are not
   working.
 * In the template folder I have a index.php file which calls a header.php, footer.
   php and sidebar.php. All these three files called are located in the same template
   folder. The sidebar file call to a customized guide.php file, located in the 
   same folder as well. The error is not appearing when loading index.php, but when
   loading guide.php, as I said called in the sidebar.php. I checked the sidebar
   file and the call to the guide file states like follows:
 *     ```
       <div class="txt">
       			<h4>Visit our product guide</h4>
       			<a href="<?php bloginfo('template_directory'); ?>/guide.php" class="boton">View guide</a>
       		</div>
       ```
   
 * When I click on the button link for guide, the Fatal error appears. I read the
   way I am calling the file (guide.php) is not correct, but I would like to know
   in a specific way, which changes I have to apply in order to make it work. I 
   am quite a begginer.
 * Thank you so much

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

 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/call-to-undefined-function-get_header-localhost/#post-4165662)
 * Normally the files in the your theme directory are templates, not files you call
   directly. You need to create a standard WordPress page and put the contents of
   guide.php in that (sans any PHP code).
 * Also, let us know that the error message is.
 *  Thread Starter [adminadminadmin](https://wordpress.org/support/users/adminadminadmin/)
 * (@adminadminadmin)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/call-to-undefined-function-get_header-localhost/#post-4165665)
 * Yes, I have the guide page created as admin in the WordPress backend. The error
   is:
    Fatal error: Call to undefined function get_header() in C:\xampp\htdocs\
   web\wp-content\themes\t\guide.php on line 7
 *  [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * (@scriptrunner)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/call-to-undefined-function-get_header-localhost/#post-4165672)
 * I’m not quite sure what you’re trying to accomplish, then. You shouldn’t need
   to call a .php file directly in an href (though in theory you could). It should
   be a standard WordPress page. If you do indeed want to call a php file, it won’t
   have any idea what `get_header()` is without WordPress core being loaded.

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

The topic ‘call to undefined function get_header() LOCALHOST’ is closed to new replies.

## Tags

 * [call](https://wordpress.org/support/topic-tag/call/)
 * [function](https://wordpress.org/support/topic-tag/function/)
 * [header](https://wordpress.org/support/topic-tag/header/)
 * [xampp](https://wordpress.org/support/topic-tag/xampp/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [Scriptrunner (Doug Sparling)](https://wordpress.org/support/users/scriptrunner/)
 * Last activity: [12 years, 8 months ago](https://wordpress.org/support/topic/call-to-undefined-function-get_header-localhost/#post-4165672)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
