Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // register post_type wheels
- function custom_post_init() {
- $labels = array(
- 'name' => 'Wheels',
- 'singular_name' => 'Wheel',
- 'add_new' => 'Add new wheel',
- 'add_new_item' => 'Add new wheel',
- 'edit_item' => 'Edit wheel',
- 'new_item' => 'New wheel',
- 'all_items' => 'All wheels',
- 'view_item' => 'View wheel',
- 'search_items' => 'Search wheels',
- 'not_found' => 'No wheels',
- 'not_found_in_trash' => 'No wheels in trash',
- 'menu_name' => 'Wheel'
- );
- $args = array(
- 'labels' => $labels,
- 'public' => true,
- 'exclude_from_search' => false,
- 'public_queryable' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- // 'show_in_admin_bar' => true,
- // 'query_var' => true,
- 'rewrite' => array( 'slug' => 'wheels', 'feeds' => true ),
- 'capability_type' => 'post',
- 'has_archive' => true,
- 'menu_position' => 30,
- // 'menu_icon' => url,
- // 'hierarchical' => false,
- 'supports' => array('title', 'editor', 'author', 'thumbnail', 'custom-fields','comments'),
- 'taxonomies' => array('category','post_tag')
- );
- register_post_type( 'wheels', $args );
- }
- add_action( 'init', 'custom_post_init' );
- function add_taxonomy_to_post_type() {
- register_taxonomy_for_object_type('category', 'wheels');
- register_taxonomy_for_object_type('post_tag', 'wheels');
- }
- add_action('init', 'add_taxonomy_to_post_type');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement