WordPress.org

Support

Support » How-To and Troubleshooting » body_class() function improperly reporting "Chrome" when viewing in IE

body_class() function improperly reporting "Chrome" when viewing in IE

  • TrevorPolischuk
    Member

    @trevorpfromsandee

    Hi,

    I’m currently running into an issue with applying conditional CSS to deal with some quirks in Internet Explorer. Usually, I just use the body_class() function to detect what browser the user is using and then output that into the <body> element. However, I’m running into an issue where in Internet Explorer, it is returning “chrome” instead of “ie” in the DOM.

    Has anyone else ever ran into this issue?

    Link below to see for yourself.


    Link

    Thanks in advance.

    -Trevor

Viewing 2 replies - 1 through 2 (of 2 total)
  • Pioneer Web Design
    Participant

    @swansonphotos

    Did you flush WP Super Cache?

    I am seeing:
    <body class="safari" data-twttr-rendered="true">
    In IE10 and latest Chrome

    Try deactivating plugins (a plugin may be also using body class?)

    TrevorPolischuk
    Member

    @trevorpfromsandee

    Ya that was it. Nice catch. I was using WP-Super Cache but I deactivated it. I’m going to try using W3 Total Cache to see if I run into the same issue.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘body_class() function improperly reporting "Chrome" when viewing in IE’ is closed to new replies.