Привет Пожалуйста, проверьте этот код как ссылку:
function gobohouse_post_type() {
register_post_type( 'gobohouse',
array(
'labels' => array(
'name' => __( 'Gobohouse' ),
'singular_name' => __( 'Gobohouse' ),
'menu_name' => __( 'Gobohouse', 'theme' ),
'name_admin_bar' => __( 'Gobohouse', 'theme' ),
),
'label' => __( 'Gobohouse', 'theme' ),
'public' => true,
'taxonomies' => array( 'hosuehold'),
'has_archive' => false,
'supports' => array( 'title','editor','thumbnail' )
)
);
}
add_action( 'init', 'gobohouse_post_type' );
add_action( 'init', 'create_hosuehold_tax' );
function create_hosuehold_tax() {
register_taxonomy(
'hosuehold',
'gobohouse',
array(
'label' => __( 'Hosuehold' ),
'rewrite' => array( 'slug' => 'hosuehold' ),
'hierarchical' => true,
'publicly_queryable' => false,
'show_admin_column' => true
)
);
}