Easy steps (Snippet) for create custom post type or multiple post types
Just copy and paste below code into functions.php or into your custom plugins file and change according to your need.. Here i create two different post types "Story" and "Chapters" . add_action( 'init', 'rj_custom_post_types' ); function rj_custom_post_types() { $cps = array(); $cps['story'] = 'Story'; // add your custom post type here slug as key and name as value. $cps['chapter'] = 'Chapter'; $icons = array('dashicons-media-interactive','dashicons-book'); // if you want to add icons then place icon slug here if(!empty($cps) && count($cps)>0) { $i = 0; foreach($cps as $key => $value) { $labels = array(); ...