跳到内容

Primary Categories

v1.0.0

Jacob McKinney · 2016年5月17日 上架

WordPress plugin for setting and displaying primary categories for posts and custom post types.

正在使用
20+
评分
4.5 / 5
累计下载
5,976
最近更新
2018年8月6日
2 条评价需要 WordPress 3.4+已测试到 4.9.36

贡献者

截图

Example of post edit screen with primary category meta box.
Example of post edit screen with primary category meta box.
Example of shortcode being used in page.
Example of shortcode being used in page.
Example output of shortcode.
Example output of shortcode.

WordPress plugin for setting and displaying primary categories for posts and custom post types*.

This plugin creates a meta box on the post edit screen titled “Primary Category” containing a drop down menu populated with all categories associated with that post**. Selecting a primary category and updating the post saves this data into a custom field with a meta key of “primary-category”.

To display a list of all posts with a particular primary category, use the shortcode [primary-category name=”cat_name”] where cat_name is the name of the primary category you wish to display. If a name is not specified, the shortcode will default to all posts with “uncategorized” set as the primary category.

*Note: Custom post types must support both categories and custom fields.

**Note: As new categories are added to a post, the post must be updated before those new categories will be available for selection as a primary category.

Plums

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

导航

说明

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

© 2026 Plums