Skip to content

Instantly share code, notes, and snippets.

@mikeyarce
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikeyarce/c20542965de328333c93 to your computer and use it in GitHub Desktop.
Save mikeyarce/c20542965de328333c93 to your computer and use it in GitHub Desktop.
Register Custom Post Type
function codex_custom_init() {
$args = array(
'public' => true,
'label' => 'Books',
'supports' => array (
'title',
'editor',
'excerpt',
'publicize',
'thumbnail',
'comments',
'revisions',
'custom-fields',
'page-attributes',
)
);
register_post_type( 'book', $args );
}
add_action( 'init', 'codex_custom_init' );
function codex_custom_init() {
$args = array(
'public' => true,
'label' => 'Books'
);
register_post_type( 'book', $args );
}
add_action( 'init', 'codex_custom_init' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment