我正在按照教程从头开始创建自定义Wordpress,但是我创建的网站略有不同。该教程创建了一个项目页面,但我正在制作一个博客页面,我需要添加选择帖子类别的功能。
我在wordpress.org上找不到信息。这是来自functions.php文件的代码。我需要在此代码中添加什么,以便我可以选择添加类别?
function gt_custom_post_type() {
register_post_type('investing',
array(
'rewrite' => array('slug' => 'investing posts'),
'labels' => array(
'name' => 'Investing Posts',
'singular_name' => 'Investing Post',
'add_new_item' => 'Add New Investing Post',
'edt_item' => 'Edit Investing Post',
),
'menu-icon' => 'dashicons-clipboard',
'public' => true,
'has_archive' => true,
'supports' => array(
'title', 'thumbnail', 'editor', 'excerpt', 'comments'
)
)
);
}
add_action('init', 'gt_custom_post_type');