Create new custom post type – WordPress

Girish Sasidharan

Ideally you should create a plugin when working with custom post types, but if you don’t know how, or just need a quick test, you can use the functions.php file in your theme.

add_action( 'init', 'software_download' );
    function software_download() {
    register_post_type( 'software_download', array() );

In its simplest form, it will create a post type which has almost no customization. It won’t be public, it won’t show up in the admin, interaction messages will be the same as posts (“post saved,” “post updated,” etc.) and so on. To tailor our new post type to our needs, I’ll go through some of the more frequently-used options and add them to the previously empty  array.

add_action( 'init', 'software_download' );          function software_download() {     register_post_type( 'software_download',         array(             'labels' => array(                 'name' => 'Download',                 'singular_name' => 'Download',                 'add_new' => 'Add New',                …

View original post 316 more words