Allows you to choose primary category for posts and custom post types.
Notice: Currently works only with WordPress Gutenberg Editor, not Classic Editor compatible
-
Allows you to choose primary category for posts and custom post types.
-
When the permalink structure includes category and the category marked as Primary, will be used for generating the permalink of the post.
-
Works with posts and custom post types.
-
Allows you to filter posts by primary category in frontend. Example: Open a custom category page
http://example.com/category-name/
. You will see that, the posts will be filtered by the primary category only. -
Whereas on category archive page,
http://example.com/category/category-name/
You will see all the posts related to that category.
- Go to WordPress Plugin's Directory and Run the following commands to install plugin:
git clone [email protected]:kishanjasani/primary-category.git
cd primary-category
composer dumpautoload
npm i
-
Now go to WordPress backend -> Plugin page -> Activate the Plugin.
-
Now you should have ability to choose primary category in post category section.
A video walkthrough of the plugin : link.
Setup Unit Test for the development:
- Go inside the
Primary Category
plugin directory - Go to
composer.json
file and editsetup-local-tests
script with your database configuration. - Then tun
composer run setup-local-tests
- Run
composer run test
The plugin follows WordPress and WordPress VIP coding standards. You can check the standard configuration inside the phpcs.xml.dist
file.