Skip to content

Instantly share code, notes, and snippets.

@clare485
Created December 3, 2013 14:30
Show Gist options
  • Save clare485/7770057 to your computer and use it in GitHub Desktop.
Save clare485/7770057 to your computer and use it in GitHub Desktop.
custom post type example
<?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')
)
);
}
?>
require_once('includes/example_custom_post_type.php');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment