Support » Fixing WordPress » Custom Post type category and tags

  • [ Moderator note: moved to Fixing WordPress. Please do not use Developing With WordPress for these topics. ]

    i’ll maked a custom post type with:

    but i cannot generate also category and tags.

    work only if i use default tags and category but this is “scramble” with articles.

    so, my question is: how i can use custom tags and categories for a custom post type?

    thanks in advance,

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,

    You have to use custom taxonomy.

    Change the ‘post’ in register_taxonomy to your custom post type.

    Thank you

    thank’u so much 😀
    work as expected now 😉

    also, can i insert two custom field in this custom post type and disable add media? 🙂

    finally, i need also (and stop, really) to set as post format like “quote”
    something like: enable post format for this custom post type, but enable only quote format (then, apply to default).

    • This reply was modified 3 years, 1 month ago by Salvatore. Reason: finally


    I do not know if it’s possible to disable add media.

    As for custom field, you can refer to the following example.

    For the add_meta_box function, there is a $screen variable, it should be your custom post type

    In the example, the custom post type is ‘food’, replace with your custom post type.

    Thank you

    for media, i’ll use this:

    function check_post_type_and_remove_media_buttons()
    	global $current_screen;
    	// use 'post', 'page' or 'custom-post-type-name'
    	if( 'quotes_db' == $current_screen->post_type )
    		remove_action('media_buttons', 'media_buttons');

    all seems to work as expected

    i need just, if is possible, to set “post format” to quote, but isn’t more important ^_^

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Custom Post type category and tags’ is closed to new replies.