Browser Body Classes with Shortcodes

plugin banner

Adds browser-specific body classes and shortcodes to show or hide content to/from specified browsers.

Author:Thom Stark (profile at wordpress.org)
WordPress version required:3.3
WordPress version tested:3.9.1
Plugin version:1.6
Added to WordPress repository:01-10-2013
Last updated:09-05-2014
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
Rating, %:100
Rated by:4
Plugin URI:http://imdb.me/thomstark
Total downloads:7 175
Active installs:40+
plugin download
Click to start download

Adds browser-specific body classes for styling, and shortcodes to show or hide content to/from specified browsers and devices.

  • As of v1.6, compatible with WordPress 3.9.

  • As of v1.5, includes new body classes, including catch-alls like: desktop, handheld, mobile, and tablet.

  • As of v1.4, includes Shortcode Generator Modal Window, and 16 new Browser Body Classes, for a total of 33.

  • As of v1.3, includes Shortcode Generator Meta Box, and an Options page, with the option to restrict access to the Meta Box according to user capability, or disable it altogether.

Browser Body Classes with Shortcodes provides more than 40 browser-specific body classes to make styling your site for different platforms and devices a cinch. The plugin also comes with two powerful, yet simple, shortcodes to specify which browsers/devices to show content to, and which to hide it from. Still don't feel like typing all those browser names? No worries! Browser Body Classes with Shortcodes comes with two different shortcode generators, with options to control who gets to use them.

The two shortcodes each have just one required attribute: [showto browser=""][/showto] and [hidefrom browser=""][/hidefrom]

  • Example: [showto browser="firefox ie10"] Your Content [/showto]

This will show the content only to Firefox and IE10.

  • Example: [hidefrom browser="opera safari chrome"] Your Content [/hidefrom]

This will hide the content only from Opera, Chrome, and Safari.

  • Example: [hidefrom browser="unknown"] Your Content [/hidefrom]

This will hide the content from any browser not in the list of browser options below.

Note: You can use other shortcodes inside these shortcodes. You can also put a [hidefrom] shortcode inside a [showto] shortcode, but not the other way around.

  • Example: [showto browser="firefox chrome"]Chrome and Firefox will see this. [hidefrom browser="firefox"]Firefox won't see this but Chrome will.[/hidefrom][/showto]

Browser options must be all lowercase and must contain a space or a comma between them if multiple are used. Acceptable Browser options are:

  • desktop

  • handheld

  • tablet

  • mobile

  • ios

  • firefox

  • chrome

  • safari

  • opera

  • maxthon

  • msie

  • ie5

  • ie6

  • ie7

  • ie8

  • ie9

  • ie10

  • ie11

  • ns4

  • lynx

  • samsunggalaxytablet

  • kindlefire

  • kindlesilk

  • ipad

  • iphone

  • ipod

  • android

  • blackberry

  • skyfire

  • operamobile

  • operamini

  • samsung

  • winmobile

  • iemobile

  • nokia

  • motorola

  • palm

  • symbian

  • lg

  • blazer

  • bolt

  • unknown


Screenshots
ChangeLog