[wordpress插件] Ambrosite Unlink Parent CategoriesAmbrosite取消链接父类别

wordpress 插件 文章 2020-02-17 14:50 482 0 全屏看文

AI助手支持GPT4.0

评分
40
描述

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.

它会影响wp_list_categories的输出以及使用该功能的所有插件和小部件。

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.

也就是说,它将父菜单项上的href属性替换为“#”(哈希/磅)标记。

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.

要创建自定义分类术语的列表,您必须设置wp_list_categories的“ taxonomy”参数。

See the FAQ for more information.

有关更多信息,请参见FAQ。

Options

选项

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

要配置插件选项,请转到WordPress管理面板中的“设置”菜单,然后单击“取消链接父类别”。

Use Dummy Links

使用虚拟链接

If you uncheck this box, the plugin will unlink the parent categories by replacing the anchor tags with span tags.

如果取消选中此框,则插件将通过将锚标签替换为span标签来取消父类别的链接。

In some themes, this may cause problems with CSS styling.

在某些主题中,这可能会导致CSS样式出现问题。

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).

为了解决此问题,您需要向定位锚标记的任何规则添加一个附加选择器(有关更多信息,请参见FAQ)。

If you are not experienced in writing CSS selectors, then it is strongly recommended to stick with dummy links.

如果您没有编写CSS选择器的经验,那么强烈建议您坚持使用虚拟链接。

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).

您可以使用逗号分隔的类别ID列表(例如:3,7,31)来指定要取消链接的类别。

If you want only the specified categories to be unlinked, then check the “Unlink specific categories only” box.

如果您希望指定的类别取消链接,则选中“仅取消特定类别的链接”框。

安装步骤

    • Upload ambrosite-unlink-parent-categories.php to the /wp-content/plugins/ directory.
    • 将ambrosite-unlink-parent-categories.php上载至/ wp-content / plugins /目录。

    • Activate the plugin through the Plugins menu in WordPress.
    • 通过WordPress中的“插件”菜单激活插件。

    • All parent categories in menus created with wp_list_categories will become unlinked as soon as the plugin is activated.

    • 激活插件后,使用wp_list_categories创建的菜单中的所有父类别将立即取消链接。

      It will also automatically unlink newly created parent categories as the category hierarchy is built.

    • 在建立类别层次结构时,它还将自动取消链接新创建的父类别。

    • Go to the Settings menu in the WordPress admin panel, and click on Unlink Parent categories to configure the plugin options.
    • 转到WordPress管理面板中的“设置”菜单,然后单击“取消链接父类别”以配置插件选项。

下载地址
https://downloads.wordpress.org/plugin/ambrosite-unlink-parent-categories.zip
-EOF-

AI助手支持GPT4.0