Skip to content

Instantly share code, notes, and snippets.

@avclark avclark/wp-cpt
Created May 11, 2012

Embed
What would you like to do?
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
You can’t perform that action at this time.