Support » Themes and Templates » [Resolved] WP bug

[Resolved] 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)
  • 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.

    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

    Any help would be greatly appreciated.

    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 ‘[Resolved] WP bug’ is closed to new replies.