[WordPress] 外掛分享: Widget Context

首頁外掛目錄 › Widget Context
WordPress 外掛 Widget Context 的封面圖片
40,000+
安裝啟用
★★★★
4.5/5 分(96 則評價)
561 天前
最後更新
問題解決
WordPress 3.0+ PHP 5.6+ v1.3.3 上架:2009-07-15

內容簡介

使用 Widget Context 外掛在網站的特定部分 (如首頁、文章、頁面、檔案、搜尋等) 中顯示或隱藏小工具。該外掛可支援使用 URL 定位來達到最大的彈性。

高級支援

訂閱我們的高級支援服務,當 PRO 🚀 版本推出時,您將免費獲得該插件版本!您的支援能夠讓插件持續維護和開發新的功能,我們非常感激。

貢獻

在Github上提供程式碼改進建議。
在WordPress.org論壇上回報錯誤或提出建議。
幫忙翻譯插件到您的語言。

文檔

小工具的可見性可以在 WordPress 管理區的「外觀 → 小工具」中的單獨小工具設置或在自訂器中的小工具編輯界面中進行配置。

按 URL 定位

「按 URL 定位」是一個強大的功能,可以根據請求 URL 定位網站的各個部分。它受到Drupal CMS類似功能的啟發。

使用相對 URL,例如page/sub-page,而不是絕對 URL https://example.com/page/sub-page,因為相對 URL 更加靈活,可以在不同的域和環境之間移植邏輯。

萬用字符

使用萬用字符*來匹配 URL 的動態部分。例如:

topic/widgets/* 可以匹配小工具類別中的所有文章,如果您的永久鏈接結構設置為/topic/%category%/%postname%,則這樣寫。

page-slug/* 可以匹配父頁面為 page-slug 的所有子頁面。

使用尾隨的?*來捕獲 URL 的所有查詢引數,例如utm_source等。例如,對於每個blog/post-slug,還包括blog/post-slug?*。

排除 URL

指定URL以忽略,即使它們被其他上下文規則匹配也是如此。例如,輸入example/sub-page即可在全局區域下選擇「所有文章」時隱藏該頁面的小工具。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.3.3) 或搜尋安裝

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

原文外掛簡介

Use Widget Context to show and hide widgets on certain sections of your site — front page, posts, pages, archives, search, etc. Use targeting by URLs (with wildcard support) for maximum flexibility.

Premium Support
Subscribe to our Premium Support service and get the PRO 🚀 version of the plugin for free when it’s launched! Your support enables consistent maintenance and new feature development, and is greatly appreciated.
Contribute

Suggest code improvements on GitHub.
Report bugs and suggestions on WordPress.org forums.
Help translate to your language.

Documentation
Widget visibility can be configured under individual widget settings under “Appearance → Widgets” in your WordPress administration area or through the widget editing interface in the Customizer.
Target by URL
The “Target by URL” is a powerful feature for targeting sections of your website based on the request URLs. It was inspired by a similar feature in the Drupal CMS.
Use relative URLs such as page/sub-page instead of absolute URLs https://example.com/page/sub-page because relative URLs are more flexible and make the logic portable between different domains and server environments.
Wildcards
Use the wildcard symbol * for matching dynamic parts of the URL. For example:

topic/widgets/* to match all posts in the widgets category, if your permalink structure is set to /topic/%category%/%postname%.

page-slug/* to match all child pages of the page-slug parent page.

Use a trailing ?* to capture URL with all query arguments such as utm_source, etc. For example, for every blog/post-slug also include blog/post-slug?*.

Exclude by URL
Specify URLs to ignore even if they’re matched by any of the other context rules. For example, enter example/sub-page to hide a widget on this page even when “All Posts” is selected under “Global Sections”.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon