插件名

Widget Context

评分

90

安装步骤:
  • Search for Widget Context under “Plugins → Add New” in your WordPress dashboard.
  • Widget Context settings will appear automatically under each widget under “Appearance → Widgets”.
  • Visit “Settings → Widget Context” to configure the available widget visibility contexts.
描述:

Use Widget Context to show or 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.

Block Context

New: We’ve started working on the Block Context plugin which brings similar functionality to Gutenberg blocks.

Contribute

Documentation

Target by URL

The “Target by URL” is a very powerful feature with a lot of flexibility 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.

  • Relative are URLs 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?*.

下载地址:
点击下载