Let’s work together
If you have a project you would like to collaborate on together, just reach out.
Contact Mefunction register_custom_work_post_type() {
register_post_type(‘work’, array(
‘labels’ => array(
‘name’ => ‘作品’,
‘singular_name’ => ‘作品’,
),
‘public’ => true,
‘has_archive’ => true,
‘show_in_rest’ => true,
‘supports’ => array(‘title’, ‘editor’, ‘thumbnail’),
‘rewrite’ => array(‘slug’ => ‘works’),
‘taxonomies’ => array(‘work_category’),
));
register_taxonomy(‘work_category’, ‘work’, array(
‘label’ => ‘作品分类’,
‘hierarchical’ => true,
‘rewrite’ => array(‘slug’ => ‘work-category’),
‘show_in_rest’ => true,
));
}
add_action(‘init’, ‘register_custom_work_post_type’);
function register_custom_work_post_type() {
register_post_type('work', array(
'labels' => array(
'name' => '作品',
'singular_name' => '作品',
),
'public' => true,
'has_archive' => true,
'show_in_rest' => true,
'supports' => array('title', 'editor', 'thumbnail'),
'rewrite' => array('slug' => 'works'),
'taxonomies' => array('work_category'),
));
register_taxonomy('work_category', 'work', array(
'label' => '作品分类',
'hierarchical' => true,
'rewrite' => array('slug' => 'work-category'),
'show_in_rest' => true,
));
}
add_action('init', 'register_custom_work_post_type');