I'm creating my own custom post type and here is the code for this:
add_action( 'init', 'create_gallery_post_type' );
function create_gallery_post_type() {
register_post_type( 'gallery',
array(
'labels' => array(
'name' => __( 'Galleries' ),
'singular_name' => __( 'Gallery' )
),
'publicly_queryable' => true,
'show_ui' => true,
'query_var' => true,
'rewrite' => true,
'capability_type' => 'post',
'hierarchical' => false,
'menu_position' => null,
'taxonomies' => array('category'),
'supports' => array('title','editor','thumbnail')
)
);
}
I have another custom post type that has it's own custom category taxonomy and that is called `portfolio-category'. I'd like to use the same taxonomy for this post type since they would be the same values and I only have to enter them in one place.
I tried to make it say:
'taxonomies' => array('portfolio-category')
This didn't show me the categories link under my Gallery post type though. Any ideas? Thanks!