benutzerdefinierter Post-Typ und Taxonomie-URL ohne Steuer-Name neu schreiben

Zur Zeit habe ich einen benutzerdefinierten Post-Typ und eine Taxonomie wie folgt:

add_action( 'init', 'create_topics_hierarchical_taxonomy', 0 ); function create_topics_hierarchical_taxonomy() { register_taxonomy('type', 'works', array( 'labels' => array( 'name' => 'Types' , 'singular_name' => 'Type' , 'search_items' => 'Search Types' , 'edit_item' => 'Edit Type' , 'add_new_item' => 'Add New Type' ), 'show_ui' => true, 'show_admin_column' => true , 'hierarchical' => true , 'query_var' => true , 'rewrite' => array('slug' => 'works/type', 'with_front' => false) )); } function custom_post_type() { $labels = array( 'name' => _x( 'Works', 'Post Type General Name', 'twentyfifteen' ), 'singular_name' => _x( 'work', 'Post Type Singular Name', 'twentyfifteen' ), 'menu_name' => __( 'Works', 'twentyfifteen' ), 'parent_item_colon' => __( 'Parent work', 'twentyfifteen' ), 'all_items' => __( 'All Works', 'twentyfifteen' ), 'view_item' => __( 'View work', 'twentyfifteen' ), 'add_new_item' => __( 'Add New work', 'twentyfifteen' ), 'add_new' => __( 'Add New', 'twentyfifteen' ), 'edit_item' => __( 'Edit work', 'twentyfifteen' ), 'update_item' => __( 'Update work', 'twentyfifteen' ), 'search_items' => __( 'Search work', 'twentyfifteen' ), 'not_found' => __( 'Not Found', 'twentyfifteen' ), 'not_found_in_trash' => __( 'Not found in Trash', 'twentyfifteen' ), ); // Set other options for Custom Post Type $args = array( 'label' => __( 'works', 'twentyfifteen' ), 'description' => __( 'work news and reviews', 'twentyfifteen' ), 'labels' => $labels, 'taxonomies' => array('type' ), 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'show_in_admin_bar' => true, 'menu_position' => 5, 'can_export' => true, 'has_archive' => false, 'exclude_from_search' => false, 'publicly_queryable' => true, 'query_var' => true, 'capability_type' => 'page', 'rewrite' => array( 'slug' => 'works' ), ); register_post_type( 'works', $args ); } add_action( 'init', 'custom_post_type', 0 ); 

Dies ermöglicht das Browsen über:

http: // localhost / funktioniert / type / testcat /

das ist nötig

http: // localhost / funktioniert / testcat /

Wie kann ich das erreichen?

Danke im Voraus.

Solutions Collecting From Web of "benutzerdefinierter Post-Typ und Taxonomie-URL ohne Steuer-Name neu schreiben"