Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action( 'init', 'cb_create_custom_postype_taxonomies', 0 ); // call function to create custom post types and taxonomy
- function cb_create_custom_postype_taxonomies(){
- global $wp_rewrite;
- //create custom post types
- register_post_type('product',
- array(
- 'label' => 'Product','description' => '','public' => true,'show_ui' => true,'show_in_menu' => true,'capability_type' => 'post','hierarchical' => false,
- 'rewrite' => array('slug' => 'products', 'with_front' => true),
- //'rewrite' => false,
- 'query_var' => true,
- 'supports' => array('title','editor','trackbacks','custom-fields','comments','thumbnail','author'),
- 'labels' => array (
- 'name' => 'Products',
- 'singular_name' => 'Product',
- 'menu_name' => 'Products',
- 'add_new' => 'Add Product',
- 'add_new_item' => 'Add New product',
- 'edit' => 'Edit',
- 'edit_item' => 'Edit Job',
- 'new_item' => 'New Job',
- 'view' => 'View Job',
- 'view_item' => 'View Job',
- 'search_items' => 'Search Jobs',
- 'not_found' => 'No Jobs Found',
- 'not_found_in_trash' => 'No Jobs Found in Trash'
- ),
- )
- );//end register custom post type Products
- //create custom taxonomy and associate with post type
- register_taxonomy('installtype',
- array ( 0 => 'product',),
- array( 'hierarchical' => true,
- 'label' => 'Installation Types','show_ui' => true,'query_var' => true,
- 'rewrite' => array('slug' => 'installtypes'),'singular_label' => 'Installation Type') );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement