Show Tag panel in custom post type

custom-post-type, php, wordpress

Solution

add this line to the section you `register_post_type` in functions.php in your theme folder

'taxonomies' => array('category', 'post_tag') 

The full code is looks like this

add_action( 'init', 'create_post_type' );
function create_post_type() {
register_post_type( 'posttypename',
        array(
            'labels' => array(
                'name' => __( 'PostTypeName' ),
                'singular_name' => __( 'PostTypeName' )
            ),
            'public' => true,
            'has_archive' => true,
            'rewrite' => array('slug' => 'posttypename'),
            'supports' => array( 'title', 'editor', 'excerpt', 'custom-fields', 'thumbnail' ),
            'taxonomies' => array('category', 'post_tag') // this is IMPORTANT
        )
    );
}

Problem

I just made a custom post type. How do I display the Tag panel on the sidebar same as what the Post post type has?

Original source