Adding a Custom Post Type to WordPress Admin

May 22nd, 2012 by
To add a Custom Post Type to the admin of wordpress place this code in the functions.php file of your theme. Replace “Slider” with the name of your custom post type.

register_post_type('slider', array(	'label' => 'Slider','description' => '','public' => true,'show_ui' => true,'show_in_menu' => true,'capability_type' => 'post','hierarchical' => false,'rewrite' => array('slug' => ''),'query_var' => true,'supports' => array('title','editor','thumbnail',),'labels' => array (
  'name' => 'Slider',
  'singular_name' => 'Slider',
  'menu_name' => 'Slider',
  'add_new' => 'Add Slider',
  'add_new_item' => 'Add New Slider',
  'edit' => 'Edit',
  'edit_item' => 'Edit Slider',
  'new_item' => 'New Slider',
  'view' => 'View Slider',
  'view_item' => 'View Slider',
  'search_items' => 'Search Slider',
  'not_found' => 'No Slider Found',
  'not_found_in_trash' => 'No Slider Found in Trash',
  'parent' => 'Parent Slider',
),) );

Post a Comment

You must be logged in to post a comment.

Cached at: 2020-10-29 08:42:31am