Support » Plugins » Taxonomy in custom post types

  • Greetings all. I am trying to use the “Post Tags” taxonomy in a custom post type that I made, however it’s not showing up. I have tried 2 things so far. First I added it to the Taxonomies option under register_post_type. I then tried to add it using register_taxonomy_for_object_type but that didn’t work either. Here is the code I’m currently using:

    register_post_type('game', array(
    	'label' => __('Games'),
    	'singular_label' => __('Game'),
    	'public' => true,
    	'publicly_queryable' => true,
    	'show_ui' => true,
    	'capability_type' => 'post',
    	'_builtin' => false,
    	'supports' => array('title', 'editor', 'thumbnail'),
    	'query_var' => 'game',
    	'taxonomies' => array('developer', 'genre', 'post_tag'),
    	'rewrite' => array("slug" => "game")

    Any help would be greatly appreciated. If any other information is needed please let me know.

Viewing 1 replies (of 1 total)
  • NVM, I got it. Found what I was looking for in this post and now it works fine. Found it here.

    I didn’t have the register_post_type in a function. Once I put it in a function and used add_action(‘init’, ‘function’) it worked with no issue.

Viewing 1 replies (of 1 total)
  • The topic ‘Taxonomy in custom post types’ is closed to new replies.