Last active
August 29, 2015 14:07
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* 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