Skip to content

Instantly share code, notes, and snippets.

@munts
Created March 9, 2017 16:39
Show Gist options
  • Save munts/4721532edb921edd51d7b3783aa2a711 to your computer and use it in GitHub Desktop.
Save munts/4721532edb921edd51d7b3783aa2a711 to your computer and use it in GitHub Desktop.
//Creating Custom Post types for Team
function setup_team_cpt(){
$labels = array(
'name' => _x('team', 'post type general name'),
'singular_name' => _x('team', 'post type singular name'),
'add_new' => _x('Add New', 'Team'),
'add_new_item' => __('Add New Team'),
'edit_item' => __('Edit Team'),
'new_item' => __('New Team'),
'all_items' => __('All Team'),
'view_item' => __('View Team'),
'search_items' => __('Search Team'),
'not_found' => __('No Team Found'),
'not_found_in_trash' => __('No Team found in the trash'),
'parent_item_colon' => '',
'menu_name' => 'Team'
);
$args = array(
'labels' => $labels,
'description' => 'The PKS Team',
'rewrite' => array('slug' => 'team'),
'public' => true,
'menu_position' => 5,
'supports' => array('title', 'editor', 'thumbnail', 'excerpt', 'comments', 'custom-fields'),
'has_archive' => true,
'taxonomies' => array(''),
'menu_icon' => 'dashicons-welcome-write-blog',
);
register_post_type('team', $args);
}
add_action('init', 'setup_team_cpt');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment