Skip to content

Instantly share code, notes, and snippets.

@nateluzod
Last active December 11, 2015 18:59
Show Gist options
  • Save nateluzod/4645900 to your computer and use it in GitHub Desktop.
Save nateluzod/4645900 to your computer and use it in GitHub Desktop.
Create custom post type in WordPress. This needs to go in the functions.php of your theme file.
add_action( 'init', 'create_type' );
function create_type() {
register_post_type( 'type',
array(
'labels' => array(
'name' => __( 'Types' ),
'singular_name' => __( 'Type' )
),
'public' => true,
'has_archive' => true,
'supports' => array( 'title', 'editor', 'thumbnail' ),
)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment