[resolved] WP bug (4 posts)

  1. ckruse
    Posted 6 years ago #

    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.

  2. s_ha_dum
    Posted 6 years ago #

    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.

  3. ckruse
    Posted 6 years ago #

    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.

  4. ckruse
    Posted 6 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic