Title: WP bug
Last modified: August 19, 2016

---

# WP bug

 *  Resolved [ckruse](https://wordpress.org/support/users/ckruse/)
 * (@ckruse)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/wp-bug/)
 * I have an error occurring on my Wp site. Not just one of them, but all of them.
   I am thinking that this is a WP bug. All of the themes being run are custom designed
   and coded. Coded by me. I have tried to debug the error myself but have had no
   luck. Perhaps this is an error I am causing.
 * The error:
 * when calling get_header(), get_sidebar(), or get_footer(), these functions are
   running several times. For example, say you have get_header() in index.php. When
   you visit index.php, the get_header() function is called several times, yet only
   displays once. I know this because I added a php mail(); call in the header.php
   file, sending an email to myself. I receive the email several times. Depending
   on the theme, anywhere from 2 times to 12 times! This is not good. I added a 
   mail() call to the default WP theme, and only received an email once. Either 
   I am coding something wrong, or some WP function I am using does this.
 * I have scoured the net in search of a solution, but have found nothing. I would
   be willing to provide one of these themes to anyone who wants to try and figure
   out the issue.

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

 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/wp-bug/#post-1365429)
 * It isn’t going to be possible to even think about this without seeing your code.
   Possibly paste an offending index.php into the [pastebin](http://wordpress.pastebin.com/).
 *  Thread Starter [ckruse](https://wordpress.org/support/users/ckruse/)
 * (@ckruse)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/wp-bug/#post-1365695)
 * Ok I finally got around to adding the code. I pasted it in the pastebin as suggested.
   I included the most basic theme set up which is causing the error. style.php,
   header.php, index.php, footer.php
 * [view code here](http://wordpress.pastebin.com/f13174b3b)
 * Any help would be greatly appreciated.
 *  Thread Starter [ckruse](https://wordpress.org/support/users/ckruse/)
 * (@ckruse)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/wp-bug/#post-1365701)
 * Figured it out. You have to actually put the bloginfo(‘template_directory’) call
   for each image. If not, wordpress seems to try to find them for you.

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

The topic ‘WP bug’ is closed to new replies.

## Tags

 * [bugs](https://wordpress.org/support/topic-tag/bugs/)
 * [get_header](https://wordpress.org/support/topic-tag/get_header/)

 * 3 replies
 * 2 participants
 * Last reply from: [ckruse](https://wordpress.org/support/users/ckruse/)
 * Last activity: [16 years, 3 months ago](https://wordpress.org/support/topic/wp-bug/#post-1365701)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
