Skip to content

Instantly share code, notes, and snippets.

@avclark
Created May 11, 2012 13:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avclark/2659532 to your computer and use it in GitHub Desktop.
Save avclark/2659532 to your computer and use it in GitHub Desktop.
Wordpress Custom Post Type
register_post_type('floorplans', array(
'label' => __('Floorplans'),
'singular_label' => __('Floorplans'),
'public' => true,
'show_ui' => true,
'capability_type' => 'post',
'hierarchical' => false,
'rewrite' => true,
'query_var' => false,
'supports' => array('title', 'editor', 'author'),
));
register_post_type('design', array(
'label' => __('Design Center'),
'singular_label' => __('Design Center'),
'public' => true,
'show_ui' => true,
'capability_type' => 'post',
'hierarchical' => false,
'rewrite' => true,
'query_var' => false,
'supports' => array('title', 'editor', 'author'),
));
add_action( 'init', 'build_taxonomies', 0 );
function build_taxonomies() {
register_taxonomy( 'plans', 'floorplans', array( 'hierarchical' => true, 'label' => 'Plans', 'query_var' => true, 'rewrite' => true ) );
register_taxonomy( 'options', 'design', array( 'hierarchical' => true, 'label' => 'Options', 'query_var' => true, 'rewrite' => true ) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment