latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Conditional for browser use?

Home Forums Community Forum Conditional for browser use?

This topic contains 5 replies, has 2 voices. Last updated by  Eduan 4 years ago.

Topic Author Topic
Posted: Tuesday Jan 1st, 2013 at 10:20 am #35891
cassel
Username: cassel

Noticing that some plugins don’t work with some specific browsers, i am hoping to add one (that uses a shortcode) but would like it to NOT display when the user is using a specific browser. Is there such a thing as a way to use the browser in a conditional?

List Of Topic Replies

Viewing 5 replies - 1 through 5 (of 5 total)
Author Replies
Author Replies
Posted: Tuesday Jan 1st, 2013 at 1:27 pm #35901
Eduan
Username: Eduan
Moderator

Basically you mean like to make a black list for each browser? So this plugin can’t run on this browser, things like that?

– Eduan

Posted: Tuesday Jan 1st, 2013 at 3:15 pm #35909
cassel
Username: cassel

Something like that. I have a shortcode to place something on some pages, but i know that it is not yet compatible with some browsers, so if i could have something like this:

if browser <>  IE 9:
    [shortcode]

So, if the viewer is using IE9 (as an example), dont bother showing what the plugin wants to show (in this case it is something like “refer-a-friend” plugin).

  • This reply was modified 4 years ago by  cassel.
Posted: Tuesday Jan 1st, 2013 at 3:30 pm #35915
Eduan
Username: Eduan
Moderator

I see.

Well there might be a plugin that does this, however I’m only aware of how to detect the current browser in the HTML header, to load different styles and JavaScript, other than that I don’t know how to detect it.

It might be worth checking Google to see if it has anything to say about “wordpress detect browser plugin” or something like that.

– Eduan

Posted: Tuesday Jan 1st, 2013 at 4:38 pm #35924
cassel
Username: cassel

Thanks for the pointer. I found this plugin:
http://wordpress.org/extend/plugins/php-browser-detection/
I might be able to do just what i wanted to do. It might be useful to others too.

Posted: Tuesday Jan 1st, 2013 at 4:48 pm #35926
Eduan
Username: Eduan
Moderator

Glad you found something! Let’s hope it works correctly for our needs. :)

– Eduan

Viewing 5 replies - 1 through 5 (of 5 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.