Skip to content

Plugin that gives you the ability to set a primary category on your posts.

Notifications You must be signed in to change notification settings

venanciorodrigo/wp-primary-category-manager

Repository files navigation

Wordpress - Primary Category Manager

Image

Gives you the ability to set a primary category on your posts.

How to install?

Simple clone or download this repo and put it on your Wordpress /plugins folder, then you can activate on WP-ADMIN.

How to use?

Set a primary category on your post:

Image

Just write the following shortcode on your post:

  • By ID - [pcm category-id='{id}']
  • By Slug Name - [pcm category-name='{slug}']

If you wish to use it on your theme:

  • <?php echo do_shortcode("[pcm category-id='{id}']"); ?>

If you wish to implement your own template to render the post list, just include the following file on your theme folder:

  • pcm_primary_category/post-list.php

Also the plugin provide a new field on the WP-API called pcm_primary_category for every post that you set the primary category.

Hooks

  • pcm_before_list - Implement code before the post list appears
  • pcm_before_item - Implement code before the item on the list appears
  • pcm_before_link - Implement code before the post link appears
  • pcm_after_link - Implement code after the post link appears
  • pcm_after_item - Implement code after the item on the list appears
  • pcm_after_list - Implement code after the post list appears

Dependencies

Improvements?

  1. Apply More PHP Unit Tests
  • Right now we're just testing one function of the plugin to proove the concept of Unit Tests and WP_MOCK.
  • The goal of this improvement is to apply tests for all functions of the plugin.
  1. Apply JS Unit Tests - QUnit

Author

About

Plugin that gives you the ability to set a primary category on your posts.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published