跳到内容

Ambrosite Unlink Parent Categories

v1.0

ambrosite · 2011年7月8日 上架

Unlinks parent categories/taxonomies in category menus and lists. Useful for creating dropdown menus with top-level placeholders.

正在使用
10+
评分
2.0 / 5
累计下载
4,191
最近更新
2011年7月13日
1 条评价需要 WordPress 2.1+已测试到 3.2.1

贡献者

截图

The Unlink Parent Categories configuration page
The Unlink Parent Categories configuration page

When activated, this plugin unlinks parent categories (that is, categories that have child categories underneath them in a hierarchy) in category menus and lists. It affects the output of wp_list_categories, as well as all plugins and widgets that use that function.

The plugin works by turning the parent category links into ‘dummy links’. That is, it replaces the href attribute on parent menu items with a ‘#’ (hash/pound) mark. A dummy link is just like a regular link, except that it leads back to the current page when clicked. The dummy links are given an inline style “cursor: default” to prevent the mouse pointer from turning into a hand when hovering over unlinked menu items.

The plugin is compatible with custom hierarchical taxonomies. To create a list of custom taxonomy terms, you must set the ‘taxonomy’ parameter of wp_list_categories. See the FAQ for more information.

Options

To configure the plugin options, go to the Settings menu in the WordPress admin panel and click on ‘Unlink Parent Categories’.

Use Dummy Links
If you uncheck this box, the plugin will unlink the parent categories by replacing the anchor tags with span tags. In some themes, this may cause problems with CSS styling. In order to fix this, you would need to add an additional selector to any rule that targets the anchor tags (see the FAQ for more information). If you are not experienced in writing CSS selectors, then it is strongly recommended to stick with dummy links.

Unlink Current Category
Unlink the current category, in addition to the parent categories.

Remove Link Titles
Remove the title attribute from the links (stops the tooltip from popping up when the mouse hovers over the menu items). This doesn’t have anything to do with unlinking parent categories, but it’s something a lot of people want, so I decided to include it.

Unlink Specific Categories
You can specify which categories you want unlinked, using a comma-separated list of category IDs (example: 3,7,31). If you want only the specified categories to be unlinked, then check the “Unlink specific categories only” box.

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums