[WordPress] 外掛分享: Body Class By URL Parameter

首頁 › 外掛目錄 › Body Class By URL Parameter
WordPress 外掛 Body Class By URL Parameter 的封面圖片
50+
安裝啟用
★★★★★
5/5 分(1 則評價)
29 天前
最後更新
—
問題解決
WordPress 4.6+ PHP 5.6+ v0.0.2 上架:2021-10-29

內容簡介

Body Class By URL Parameter 外掛根據 URL 中的參數為網頁的 body 添加 CSS 類別,讓使用者能夠根據不同的查詢參數自訂樣式,提升網頁的靈活性與可視化效果。

【主要功能】
• 根據 URL 參數添加 CSS 類別
• 支援自訂樣式以隱藏特定元素
• 需要基本 CSS 技能來使用

外掛標籤

開發者團隊

⬇ 下載最新版 (v0.0.2) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Body Class By URL Parameter」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

It adds CSS classes to the body depending on the parameters included in the URL.
For each URL query argument, the plugin adds a CSS class to the body that is composed by [bc]-[paramenter name]-[parameter value].
Where [bc] is the a prefix that is always the same.
If for example you share your page https://your-domain.com/sample-page on Facebook, the user after clicking on the link will land on a page having an URL that looks like https://your-domain.com/sample-page/?fbclid=IwAR0o12nq9Em-x1n
In this case the plugin would add the class bc-fbclid-IwAR0o12nq9Em-x1n to the body.
Then you can use that class for your custom CSS.
.bc-fbclid-IwAR0o12nq9Em-x1n .disable-for-facebook{
display:none !important
}

In the example above you hide all the elements that have the class .disable-for-facebook if the users come from the link shared on Facebook.
This is just an example. You can use it to create different styles depending on whatever query arguments are included in the URL.
The use of this plugin requires that you have at least basic CSS skills and you know where to put your custom CSS. All other users will not be able to take advantage of this plugin.
0.0.2

Checked WordPress 6.4

0.0.1
*Initial release

延伸相關外掛

文章
Filter
Mastodon