• Hello,
    I am having some trouble with the body_class() function. I have a custom background and it should be giving my body tag the class “custom-background” among others. It doesn’t work on Windows Chrome or Firefox, both are the latest version. The odd part is that it does work on Mac Chrome and Safari…
    The only tag I am getting on the windows version of the site is “customize -support” and on the Mac version I am getting about 6 classes, all that should be there. I have tried disabling all plugins and tried with a fresh install of firefox.
    I am using a theme called Sixteen but I haven’t found any place where the body_class method is overridden.
    Anyone with some ideas I could try would be great. Thanks!
    Oh, for reference, my body tag looks like:
    <body <?php body_class(''); ?>>
    I have also tried with an argument and it works on the Mac but not on the Windows machine. If there is any extra info you need, just ask.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Try:

    <body <?php body_class(); ?>>

    Thread Starter mastermaddix

    (@mastermaddix)

    Thanks for the suggestion, I gave it a try but it didn’t make a difference.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    First step: Eliminate the theme as the problem by temporarily switching to Twenty Thirteen and seeing if it works there. If it does, then the theme is doing it, even if you don’t know where. If not, then it’s not the theme.

    Second step: Eliminate the plugins. Same principle, disable them, try again, repeat until you find the one causing the issue.

    Also note that there is no sane reason for it to work on one machine but not on another. Make sure that you’re actually looking at the same website on both machines. Put in something like “test” after the body opener, then reload the site on both machines. See if it appears on both.

    josh_fester

    (@josh_fester)

    Was this ever resolved? I have this problem on a couple sites. Makes absolutely no sense. I solved it by adding the body_class() to a wrapper div, because any attributes on the body tag just disappear in Windows browsers.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘body_class doesn't work on chrome windows’ is closed to new replies.