Вам не хватает add_action('init', 'testimonials_regiser');
после функции.
Более подробный код, который немного более индивидуален, может быть следующим:
function testimonials_register() {
$labels = array(
'name' => _x( 'Testimonials', 'post type general name' ),
'singular_name' => _x( 'Testimonial', 'post type singular name' ),
'add_new' => _x( 'Add New', 'testimonial' ),
'add_new_item' => __( 'Add New Testimonial' ),
'edit_item' => __( 'Edit Testimonial' ),
'new_item' => __( 'New Testimonial' ),
'all_items' => __( 'All Testimonials' ),
'view_item' => __( 'View Testimonial' ),
'search_items' => __( 'Search Testimonials' ),
'not_found' => __( 'No testimonials found' ),
'not_found_in_trash' => __( 'No testimonials found in the Trash' ),
'parent_item_colon' => '',
'menu_name' => 'Testimonial'
);
$args = array(
'labels' => $labels,
'description' => '',
'public' => true,
'menu_position' => 5,
'supports' => array( 'title', 'editor'),
'has_archive' => true,
);
register_post_type( 'testimonial', $args );
}
add_action( 'init', 'testimonials_register' );
Вот хорошее руководство .