Skip to content

Instantly share code, notes, and snippets.

@alwayscoding
Created March 22, 2013 15:15
Show Gist options
  • Save alwayscoding/5222043 to your computer and use it in GitHub Desktop.
Save alwayscoding/5222043 to your computer and use it in GitHub Desktop.
WORDPRESS: CREATE CUSTOM POST TYPE
/**
* ADD HELLOPEOPLE POST TYPE
*/
add_action( 'init', 'create_post_type' );
function create_post_type() {
register_post_type('celebrities', array( 'label' => 'Celebrities','description' => 'Display images in three columns','public' => true,'show_ui' => true,'show_in_menu' => true,'capability_type' => 'post','hierarchical' => true,'rewrite' => array('slug' => ''),'query_var' => true,'has_archive' => true,'exclude_from_search' => false,'supports' => array('title','editor','excerpt','trackbacks','custom-fields','comments','revisions','thumbnail','author','page-attributes',),'taxonomies' => array('celebrities',),'labels' => array (
'name' => 'Celebrities',
'singular_name' => 'celebrity',
'menu_name' => 'Celebrities',
'add_new' => 'Add celebrity',
'add_new_item' => 'Add New celebrity',
'edit' => 'Edit',
'edit_item' => 'Edit celebrity',
'new_item' => 'New celebrity',
'view' => 'View celebrity',
'view_item' => 'View celebrity',
'search_items' => 'Search Celebrities',
'not_found' => 'No Celebrities Found',
'not_found_in_trash' => 'No Celebrities Found in Trash',
'parent' => 'Parent celebrity',
),) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment