clare485
12/3/2013 - 2:30 PM

custom post type example

custom post type example

require_once('includes/example_custom_post_type.php');
<?php

add_action('init', 'create_product_post_type');

function create_product_post_type() {
  register_post_type('product' , array(
      'labels' => array(
          'name' => __('product'),
          'singular_name' => __('product')
      ),
      'slug' => "product",
      'public' => true,
      'hierarchical' => true,
      'rewrite' => array("slug" => "product"),
      'has_archive' => false,
      //'taxonomies' => array('product-category'),
      'supports' => array('title', 'editor', 'excerpt', 'custom-fields', 'thumbnail')
          )
  );
}

?>