Beskriuwing
Features:
* Ability to designate a primary category for posts and custom post types.
* Supports custom post types and custom taxonomies with hierarchical structure.
* Category in permalink is the primary category, if one is set.
* Shortcode for displaying posts with a specific primary category.
* CLI command for listing posts with a specific primary category.
Ynstallaasje
- Add the plugin folder to WordPress’ plugin directory.
- Activate the plugin from Admin > Plugins.
- Start using it.
FAQ
- Installation Instructions
-
- Add the plugin folder to WordPress’ plugin directory.
- Activate the plugin from Admin > Plugins.
- Start using it.
- When using the shortcode, do I need to use the primary category’s ID, slug or name?
-
You can use either of them. E.g. assuming a category with ID 3, slug ‘ground-coffee’ and name ‘Ground Coffee’.
the following shortcode definitions will all work:[posts_by_primary_category category="3"] [posts_by_primary_category category="ground-coffee"] [posts_by_primary_category category="Ground Coffee"]
- Developers’ Notes
-
If you want to fetch posts belonging to a particular category (or, more generally, belonging to a particular term)
you can use this:if ( class_exists( 'SPC_Queries' ) ) { /* * Let's fetch 10 published posts with primary category set to category ID 2. */ $spc_queries = SPC_Infrastructure_Container::get_instance()->get( 'SPC_Queries' ); $posts = $spc_queries->get_primary_term_posts( 2, array( 'post_status' => 'publish', 'posts_per_page' => 10, 'post_type' => 'post', ) ); }
You can just as well pass a category slug or name, instead of its ID, if you prefer.
Resinsjes
D’r binne gjin resinsjes foar dizze plugin.
Meiwurkers & amp; Untwikkelders
“Select Primary Category” is iepen boarne software. De folgjende minsken hawwe bydroegen oan dizze plugin.
MeiwurkersOersette “Select Primary Category” yn jo taal.
Ynteressearre yn ûntwikkeling?
Blêdzje troch de koade , besjoch de SVN-repository , of abonnearje op it ûntwikkelingslogboek troch RSS .
Feroaringslog
1.0
- Initial public release.