WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. TrevorPolischuk
    Member
    Posted 1 year ago #

    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

  2. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

    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?)

  3. TrevorPolischuk
    Member
    Posted 1 year ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic