Plugin info

Total downloads: 1,054
Active installs: 0
Total reviews: 0
Average rating: 0
Support threads opened: 0
Support threads resolved: 0 (0%)
Available in: 1 language(s)
Contributors: 1
Last updated: 6/13/2018 (2754 days ago)
Added to WordPress: 6/13/2018 (7 years old)
Minimum WordPress version: 4.5
Tested up to WordPress version: f
Minimum PHP version: f

Maintenance & Compatibility

Maintenance score

Possibly abandoned • Last updated 2754 days ago

20/100

Is Select Primary Category abandoned?

Possibly abandoned (last update 2754 days ago).

Compatibility

Requires WordPress: 4.5
Tested up to: f
Requires PHP: f

Languages

Similar & Alternatives

Explore plugins with similar tags, and compare key metrics like downloads, ratings, updates, support, and WP/PHP compatibility.

Simple Primary Category
Rating 5.0/5 (1 reviews)Active installs 200
WordPress Primary Category
Rating 0.0/5 (0 reviews)Active installs 30
Primary Addon for Elementor
Rating 5.0/5 (2 reviews)Active installs 8,000
Easy Primary Category
Rating 5.0/5 (4 reviews)Active installs 1,000
Primary Redirect
Rating 5.0/5 (2 reviews)Active installs 10
Top Cat
Rating 0.0/5 (0 reviews)Active installs 10

Description

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.

Installation

  1. Add the plugin folder to WordPress’ plugin directory.
  2. Activate the plugin from Admin > Plugins.
  3. Start using it.

Frequently Asked Questions

Installation Instructions

  1. Add the plugin folder to WordPress’ plugin directory.
  2. Activate the plugin from Admin > Plugins.
  3. 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.

Review feed

No reviews available

Screenshots

No screenshots available

Changelog

1.0

  • Initial public release.