Forums

Custom Post Widget
[resolved] Trouble adding "category" taxonomy (3 posts)

  1. dbraphael
    Member
    Posted 8 months ago #

    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/

  2. Johan van der Wijk
    Member
    Plugin Author

    Posted 7 months ago #

    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

  3. dbraphael
    Member
    Posted 7 months ago #

    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.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.