WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Bizarre background-image bug in theme (9 posts)

  1. everwill
    Member
    Posted 2 years ago #

    Did I mention this is bizarre?

    Okay, I have a couple of variant-themes. It would probably be easier to use one theme and but various backgrounds and other tweaks in dynamically, but 1. I don't know how to do it and 2. I think it will load faster if I hard-code.

    So I've successfully copied a base theme several times and made numerous stylistic tweaks each time. Then I come to a particular domain where I am using a background image called bak-1.jpg. Usually I leave the code here the same and upload a new image, but sometimes I point to another image.

    What I first thought that I determined through trial and error is that I get a bug when I use any name other than bak-1.jpg in my style sheet for the page background. The error is shows this at the top of the page:
    _gaq.push(['_trackPageview']); _gaq.push(['_trackPageLoadTime']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })();

    God only knows how or why. I monkeyed with it for a long while and then just said, okay when then I don't have this problem on any of the other domains. I'll just make a new bak-1 and name it bak-3 for those domains that use bak-1 and then I'll overwrite bak-1 with the look I want.

    But here's where it takes a turn for the truly bizarre. If I leave the file name the same but change the image to another look---I get the error. In other words, something as simple as a color change in the image makes the page break. I'm at a loss as I can't even imagine how or why this is the case.

  2. 1. Depending on the changes, you can use the safe CSS plugin.

    2. Not any faster.

    Start with turning off your plugins. That particular error looks like Google Analytics, so shut it off for now.

  3. everwill
    Member
    Posted 2 years ago #

    That was the first think I checked. Made no difference.

  4. Did you turn ALL the plugins off?

  5. everwill
    Member
    Posted 2 years ago #

    I don't know "safe CSS". Tried searching and couldn't find.

    What's bizarre about this is that if I change the image---meaning alter the image---I get the script error. I can change the image name to anything I like, so long as it is the exact same image it will not report an error. If I change the actual image itself, green to maroon, green to grey, then I get the error.

    I though the images were totally self-contained and can't image how on Earth it could ever begin to cause this quirky problem.

  6. everwill
    Member
    Posted 2 years ago #

    @plugins ...

    Yes. I tried all that yesterday when I first started having problems.

    The other bizarre thing is that I don't have this problem on other domains. Just this domain. http://mount-vernon-homes.com

    I though made it had something to do with they hyphens so as part of my troubleshoot yesterday I tried a filename with no hyphens. Made no difference.

  7. everwill
    Member
    Posted 2 years ago #

    Unreal.

    I desaturated the image and reposted. Now with no color there is no error.

    So I went really adventurous and put a little hint of color back in the image. No error.

    I'm I going crazy or is it even possible for an image color to break code?!

  8. everwill
    Member
    Posted 2 years ago #

    I'm going to crawl back into my hole now, but all I can say for the next guy. Here's how I solved:

    I "desaturated" image and posted it back. Before that anytime I attempted to change the image, the code was broken. I have no idea how this could happen, but I today I saw bigfoot flying his UFO through my code.

Topic Closed

This topic has been closed to new replies.

About this Topic