Skip to content

Instantly share code, notes, and snippets.

@michaelmusgrove
Last active August 29, 2015 14:07
Show Gist options
  • Save michaelmusgrove/54cc481de2c5734596cb to your computer and use it in GitHub Desktop.
Save michaelmusgrove/54cc481de2c5734596cb to your computer and use it in GitHub Desktop.
Create Custom Post Type in WordPress. 2nd file enable adding cats and tags to the CPT.
'taxonomies' => array('category', 'post_tag'),
//* Create Custom Post Type add_action( 'init', 'add_custom_post_type' ); function add_custom_post_type() {   register_post_type( 'members', array( 'labels' => array( 'name' => __( 'Members', 'wpsites' ), 'singular_name' => __( 'Member', 'wpsites' ), ), 'has_archive' => true, 'hierarchical' => true, 'menu_icon' => 'dashicons-admin-users', 'public' => true, 'rewrite' => array( 'slug' => 'members', 'with_front' => false ), 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'revisions', 'page-attributes' ), 'taxonomies' => array( 'member-type' ), 'menu_position' => 2,   )); }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment