https://github.com/localjo/wp-minimal-primary-category
A WordPress plugin that lets you designate a primary category for posts.
https://github.com/localjo/wp-minimal-primary-category
Last synced: 2 months ago
JSON representation
A WordPress plugin that lets you designate a primary category for posts.
- Host: GitHub
- URL: https://github.com/localjo/wp-minimal-primary-category
- Owner: localjo
- Created: 2018-04-20T02:26:35.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-20T02:26:57.000Z (about 7 years ago)
- Last Synced: 2025-01-06T04:28:44.808Z (4 months ago)
- Language: PHP
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.txt
Awesome Lists containing this project
README
=== Minimal Primary Category ===
Contributors: josiahsprague
Donate link: http://josiahsprague.com/
Tags: category, categories, primary
Requires at least: 3.0.1
Tested up to: 3.9.1
Stable tag: trunk
License: MIT
License URI: http://opensource.org/licenses/MITA plugin that lets you designate a primary category for posts.
== Description ==
A plugin that lets you designate a primary category for posts with multiple categories.
== Installation ==
1. Upload the plugin files to the `/wp-content/plugins/` directory
2. Activate the plugin through the 'Plugins' menu in WordPress== Frequently Asked Questions ==
= How do I set a primary category for a post? =
First, assign multiple categories to a post. Then you will see a "Make primary" button next to the categories in the post editor. Click on that button to designate a category as the primary.
= How do I display the primary category of a post in a theme? =
You can use `mp_category_get_primary_category()` to access the primary category. Example;
```
if ( function_exists( 'mp_category_get_primary_category' ) ) {
$primary_cat = mp_category_get_primary_category( get_the_ID() );
echo $primary_cat->name;
}
```= 0.0.1 =
* Initial version