
內容簡介
該外掛為網站增加瀏覽器特定的 body class,讓網站樣式設計更加容易,並提供 shortcode 功能,可讓特定瀏覽器和裝置上顯示或隱藏內容。
此版本(v1.6)相容於 WordPress 3.9 以上版本。
此版本(v1.5)新增了許多 body classes,其中包括常用的 desktop、handheld、mobile 和 tablet 等。
此版本(v1.4)增加了 Shortcode Generator Modal Window 功能和 16 種新的瀏覽器 body classes,共計 33 種。
此版本(v1.3)加入了 Shortcode Generator Meta Box 功能和 Options 頁面,讓您可以限制使用者權限以存取 Meta Box 或完全禁用此功能。
「Browser Body Classes with Shortcodes」外掛提供超過 40 種瀏覽器特定的 body class,讓您輕鬆設計不同平台和裝置的網站樣式。此外掛還提供兩個強大且簡單的 shortcode 功能,可指定要在哪些瀏覽器或裝置上顯示或隱藏內容。對於不想記得所有瀏覽器名稱的人來說,這個外掛還提供兩種 shortcode 產生器,讓您控制誰可以使用這些功能。
這兩個 shortcode 都只有一個必填屬性:[showto browser=””][/showto] 和 [hidefrom browser=””][/hidefrom]
例如:[showto browser=”firefox ie10″] 您的內容 [/showto]
此內容僅會在 Firefox 和 IE10 上顯示。
例如:[hidefrom browser=”opera safari chrome”] 您的內容 [/hidefrom]
此內容僅不會在 Opera、Chrome 和 Safari 上顯示。
例如:[hidefrom browser=”unknown”] 您的內容 [/hidefrom]
此內容會在以下瀏覽器選項以外的瀏覽器上顯示。
注意:您可以在這些 shortcode 內使用其他 shortcode。您也可以在 [showto] shortcode 中放入 [hidefrom] shortcode,但不能反過來放。
例如:[showto browser=”firefox chrome”]Chrome 和 Firefox 看得到此內容。 [hidefrom browser=”firefox”]只有 Chrome 能看到但 Firefox 看不到。[/hidefrom][/showto]
瀏覽器選項必須全部小寫,而如果使用多個瀏覽器選項,則它們之間必須包含空格或逗號。可接受的瀏覽器選項如下:
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
外掛標籤
開發者團隊
② 後台搜尋「Browser Body Classes with Shortcodes」→ 直接安裝(推薦)
原文外掛簡介
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
Requirements
PHP 5.2+
WordPress 3.3+
