Last active
December 14, 2015 05:09
-
-
Save doughamlin/5033709 to your computer and use it in GitHub Desktop.
Register a new content type in WordPress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('init', 'CONTENTTYPE_register'); | |
function CONTENTTYPE_register() { | |
$labels = array( | |
'name' => _x('CONTENTTYPE NAME', 'post type general name'), | |
'singular_name' => _x('CONTENTTYPE NAME', 'post type singular name'), | |
'add_new' => _x('Add New', 'CONTENTTYPE NAME'), | |
'add_new_item' => __('Add New CONTENTTYPE NAME'), | |
'edit_item' => __('Edit CONTENTTYPE NAME'), | |
'new_item' => __('New CONTENTTYPE NAME'), | |
'view_item' => __('View CONTENTTYPE NAME'), | |
'search_items' => __('Search CONTENTTYPE NAME'), | |
'not_found' => __('Nothing found'), | |
'parent_item_colon' => '' | |
); | |
$args = array( | |
'labels' => $labels, | |
'public' => true, | |
'publicly_queryable' => true, | |
'show_ui' => true, | |
'query_var' => true, | |
'menu_icon' => get_stylesheet_directory_uri() . '/images/icon_album.png', | |
'rewrite' => array('slug' => 'ortho-pinion'), | |
'capability_type' => 'post', | |
'hierarchical' => false, | |
'menu_position' => null, | |
'supports' => array('title','editor','categories','thumbnail'), | |
); | |
register_post_type( 'CONTENTTYPE' , $args ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment