Create Custom Post Type with Category in WordPress without plugin
'name' => 'Custom Post', 'singular_name' => 'custom', ), 'hierarchical' => true, 'public' => true, 'has_archive' => true, 'menu_icon' => 'dashicons-welcome-write-blog', 'supports' => array('title', 'editor', 'thumbnail'), ); register_post_type('custom post', $args); } add_action('init', 'news_custom_post'); ?>
Syntax:
'name' => 'Any Custom-Post-Name', 'singular_name' => 'singular-name of Custom-Post-Name', ), 'hierarchical' => true, 'public' => true, 'has_archive' => true, 'menu_icon' => 'dashboard wordpress icon shortcode', 'supports' => array('title', 'editor', 'thumbnail'), ); register_post_ype('Any Custom-Post-Name', $args); } add_action('init', 'function-name'); ?>
Output: