WordPress.org

Ready to get started?Download WordPress

Forums

Taxonomy in custom post types (2 posts)

  1. c0nc3pt.SF
    Member
    Posted 4 years ago #

    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.

  2. c0nc3pt.SF
    Member
    Posted 4 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic