• Resolved anabelle

    (@anabelle)


    Is there a way of showing some content only for “non firefox” visitors?

    i want to display a “This site works better with firefox, get it here” but i think is ridiculous to show such text to firefox users.

    Is there something i can do to do this?

Viewing 9 replies - 1 through 9 (of 9 total)
  • <!--[if IE]>
    blah blah blah
    <![endif]-->

    Please dont forget to mark this resolved.

    and yes, I do realize you asked about non-firefox users, not ie users. theres no equivalent way to do something that _excludes_ firefox users that i am aware of, UNLESS you want to use javascript.

    I would target ie users anyway, since chances are if someone isnt using firefox but also isnt using ie, theyre prolly well aware of the existance of ff and chose not to use it.

    Thread Starter anabelle

    (@anabelle)

    ok, that’s IF ie, but im looking for “IF firefox: nothing, else: content”

    and you didnt read what i wrote apparantly.

    there is NO conditional comment for excluding FF users. conditonal comments are an IE thing.

    if you want to do a simple browser detection thing, google browser detection javascript.

    Hoping you realize that a fair number of users disable javascript.

    ..

    Thread Starter anabelle

    (@anabelle)

    youre right about targeting IE users, and Javascript, I will do it that way, and sorry i didn’t read but I swear i haven’t seen it… ? did you edit your post after? i think you did!

    Thread Starter anabelle

    (@anabelle)

    Another question… just guessing does this work with safari?

    <!–[if safari]>
    blah blah blah
    <![endif]–>

    wich browsers are detected and by wich tag? im seeing a lot of posibilities here.. thanks!

    You could do it with some simple PHP browser detection instead:

    <?php
    $ua = strtolower($_SERVER['HTTP_USER_AGENT']);
    if (strpos($ua, 'mozilla') === false || strpos($ua, 'firefox') === false) {
    echo 'This site works better with <a href="https://www.mozilla.com/firefox/">Firefox</a>.';
    }
    ?>

    Put that in the appropriate place in whatever theme you’re using.

    Thread Starter anabelle

    (@anabelle)

    thank you VERY VERY much, but im still interested in the working browser tags for te if condition in wordpress.

    I’d have a couple of questions.

    First, does the site *really* work better with Firefox than with other browsers? If so, I’d tend to the code, because sites can (and, in my opinion, should) be made workable in all browsers. Cross-browser compatibility is vital.

    Secondly, well, I use Opera, which is at least as advanced as Firefox; telling me to upgrade to Firefox would be along the lines of Macromedia bouncing me out of its shopping cart mid-purchase to upgrade to IE or ::cough:: the AOL browser, which has happened.

    pizdin_dim’s suggestion is great, and will work just fine.

    <!–[if safari]>
    blah blah blah
    <![endif]–>

    Again, youre not reading — thats called a conditional comment, and conditional comments are for ie ONLY. you cannot plugin firefox, safari, camino, flock, etc..

    it wont work.

    @dianev : thats exactly why I suggested targeting ie users only in my first post — ppl like you have already made the switch to “another” browser. ??

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Browser dependant content’ is closed to new replies.