I have copied custom post type code from WordPress and modified and added to function.php but Where is the categories box. I cant seen anywhere. I want also for this post.
I am not good for WordPress So please guide me to solve this issue.
Thanks 🙂
My Code:
function codex_custom_init() {
$labels = array(
'name' => 'Prices',
'singular_name' => 'Price',
'add_new' => 'Add New',
'add_new_item' => 'Add New Price',
'edit_item' => 'Edit Price',
'new_item' => 'New Price',
'all_items' => 'All Prices',
'view_item' => 'View Price',
'search_items' => 'Search Prices',
'not_found' => 'No prices found',
'not_found_in_trash' => 'No prices found in Trash',
'parent_item_colon' => '',
'menu_name' => 'Prices'
);
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'price' ),
'capability_type' => 'post',
'has_archive' => true,
'hierarchical' => false,
'menu_position' => null,
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' )
);
register_post_type( 'price', $args );
}
add_action( 'init', 'codex_custom_init' );
Hey Manan try this code: