Title: &#8220;Fatal error: Call to undefined function get_header()&#8230;&#8221;
Last modified: August 19, 2016

---

# “Fatal error: Call to undefined function get_header()…”

 *  Resolved [christian_d](https://wordpress.org/support/users/christian_d/)
 * (@christian_d)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/fatal-error-call-to-undefined-function-get_header-5/)
 * I’m working on a site ([http://jennifer.coffeeismagic.com/](http://jennifer.coffeeismagic.com/))
   and, when I was initially formatting WordPress I didn’t want that many features
   so I stripped out all the `<?php get_sidebar() ?>` stuff. I realized after the
   fact that I actually wanted the sidebar on the front page so I stuck that bit
   of code back in on the archive.php and archives.php files, right where it was
   before, above get_footer — to no effect. So I decided to stick `<?php get_sidebar()?
   >` back into the index.php file and when I did that it totally crashed the site,
   saying “Fatal error: Call to undefined function get_header() in /home/christian_d/
   jennifer.coffeeismagic.com/index.php on line 1”. I didn’t change anything other
   than adding get_sidebar and when I took it back out it still gives me that error.
   The header.php file is still intact in the same place it was on the server so
   i don’t know what’s going on. Any ideas are much appreciated!
 * Here is the code of index.php:
 *     ```
       <?php get_header() ?>
   
       	<div id="container">
       		<div id="content">
   
       			<div id="nav-above" class="navigation">
       				<div class="nav-previous"><?php next_posts_link(__( '<span class="meta-nav">&laquo;</span> Older posts', 'sandbox' )) ?></div>
       				<div class="nav-next"><?php previous_posts_link(__( 'Newer posts <span class="meta-nav">&raquo;</span>', 'sandbox' )) ?></div>
       			</div>
   
       <?php while ( have_posts() ) : the_post() ?>
   
       			<div id="post-<?php the_ID() ?>" class="<?php sandbox_post_class() ?>">
       				<h2 class="entry-title"><a href="<?php the_permalink() ?>" title="<?php printf( __('Permalink to %s', 'sandbox'), the_title_attribute('echo=0') ) ?>" rel="bookmark"><?php the_title() ?></a></h2>
       				<div class="entry-date"><abbr class="published" title="<?php the_time('Y-m-d\TH:i:sO') ?>"><?php unset($previousday); printf( __( '%1$s – %2$s', 'sandbox' ), the_date( '', '', '', false ), get_the_time() ) ?></abbr></div>
       				<div class="entry-content">
       <?php the_content( __( 'Read More <span class="meta-nav">&raquo;</span>', 'sandbox' ) ) ?>
   
       				<?php wp_link_pages('before=<div class="page-link">' . __( 'Pages:', 'sandbox' ) . '&after=</div>') ?>
       				</div>
   
       			</div><!-- .post -->
   
       <?php comments_template() ?>
   
       <?php endwhile; ?>
   
       			<div id="nav-below" class="navigation">
       				<div class="nav-previous"><?php next_posts_link(__( '<span class="meta-nav">&laquo;</span> Older posts', 'sandbox' )) ?></div>
       				<div class="nav-next"><?php previous_posts_link(__( 'Newer posts <span class="meta-nav">&raquo;</span>', 'sandbox' )) ?></div>
       			</div>
   
       		</div><!-- #content -->
       	</div><!-- #container -->
   
       <?php get_footer() ?>
       ```
   

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

 *  [whooami](https://wordpress.org/support/users/whooami/)
 * (@whooami)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/fatal-error-call-to-undefined-function-get_header-5/#post-1186284)
 * > “Fatal error: Call to undefined function get_header() in /home/christian_d/
   > jennifer.coffeeismagic.com/index.php on line 1
 * > I’m working on a site
 * someone else ‘working on a site” that doesnt get wordpress. (surprise surprise)
 * you edited the wrong file.
 * the index.php that lives in the root directory (thats the directory with the 
   wp-config.php in it) is NOT a theme file.
 * I suggest you do some reading of the docs before taking on wordpress gigs, be
   they paid or unpaid (no offense, just honest)
 *  Thread Starter [christian_d](https://wordpress.org/support/users/christian_d/)
 * (@christian_d)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/fatal-error-call-to-undefined-function-get_header-5/#post-1186285)
 * Oh man, what a dumb mistake. The last time I worked on this site was last week
   and I logged into my FTP and today I just edited the first index.php file I saw
   without thinking.
 * No need to be so snooty, people make mistakes….
 *  [OviLiz](https://wordpress.org/support/users/ovib/)
 * (@ovib)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/fatal-error-call-to-undefined-function-get_header-5/#post-1186703)
 * same to me… we work too much! 😀

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

The topic ‘“Fatal error: Call to undefined function get_header()…”’ is closed to
new replies.

## Tags

 * [fatal error](https://wordpress.org/support/topic-tag/fatal-error/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 3 participants
 * Last reply from: [OviLiz](https://wordpress.org/support/users/ovib/)
 * Last activity: [16 years, 7 months ago](https://wordpress.org/support/topic/fatal-error-call-to-undefined-function-get_header-5/#post-1186703)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
