How do I add post ‘category to a custom theme?
-
Im following a tutorial to create a custom WordPress them from scratch, but I’m creating my site slightly different. The tutorial created a project page, but I’m making a blog page and I need to add the ability to select categories for the posts.
Here is my code from the functions.php file. What do I need to add to this code so that I’ll have the option to add categories?
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');
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘How do I add post ‘category to a custom theme?’ is closed to new replies.