Title: [Plugin: Custom Post Widget] Trouble adding &quot;category&quot; taxonomy
Last modified: August 20, 2016

---

# [Plugin: Custom Post Widget] Trouble adding "category" taxonomy

 *  Resolved [dbraphael](https://wordpress.org/support/users/dbraphael/)
 * (@dbraphael)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-custom-post-widget-trouble-adding-category-taxonomy/)
 * I have place the following code in my functions.php file and cannot seem to register
   the category taxonomy to use with Content Block. Any thoughts on why this may
   be occurring?
 * `
    function reg_tag() { register_taxonomy_for_object_type('category', 'content_block');}
   add_action('init', 'reg_tag');
 * [http://wordpress.org/extend/plugins/custom-post-widget/](http://wordpress.org/extend/plugins/custom-post-widget/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Johan van der Wijk](https://wordpress.org/support/users/vanderwijk/)
 * (@vanderwijk)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-custom-post-widget-trouble-adding-category-taxonomy/#post-3019908)
 * To try to keep the plugin as simple as possible to use, I deliberately did not
   include support for categories. I’m not sure why your code is not working as 
   it looks completely valid but as a test you could try modifying the plugin code
   and include the taxonomy directly on line 119 of post-widget.php to see if that
   works.
 * ‘taxonomies’ => array(‘category’, ‘post_tag’)
 * To display a category on the front end you also seem to have to change exclude_from_search
   to ‘false’. See: [http://codex.wordpress.org/Function_Reference/register_post_type](http://codex.wordpress.org/Function_Reference/register_post_type)
 *  Thread Starter [dbraphael](https://wordpress.org/support/users/dbraphael/)
 * (@dbraphael)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-custom-post-widget-trouble-adding-category-taxonomy/#post-3019911)
 * Thanks for the note. I actually only use the categories to help filter the content
   on the admin side as I have a a fairly large site.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Plugin: Custom Post Widget] Trouble adding "category" taxonomy’ is closed
to new replies.

 * ![](https://ps.w.org/custom-post-widget/assets/icon.svg?rev=2884166)
 * [Content Blocks (Custom Post Widget)](https://wordpress.org/plugins/custom-post-widget/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-post-widget/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-post-widget/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-post-widget/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-post-widget/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-post-widget/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [dbraphael](https://wordpress.org/support/users/dbraphael/)
 * Last activity: [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-custom-post-widget-trouble-adding-category-taxonomy/#post-3019911)
 * Status: resolved