Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* Register Custom Post Type for CD */
- add_action('init', 'cd_post_type_init');
- function cd_post_type_init() {
- $labels = array(
- 'name' => _x('CD', 'post type general name'),
- 'singular_name' => _x('cd', 'post type singular name'),
- 'add_new' => _x('Add New', 'CD'),
- 'add_new_item' => __('Add New CD'),
- 'edit_item' => __('Edit CD'),
- 'new_item' => __('New CD'),
- 'view_item' => __('View CD'),
- 'search_items' => __('Search CDs'),
- 'not_found' => __('No CDs found'),
- 'not_found_in_trash' => __('No CDs found in Trash'),
- 'parent_item_colon' => ''
- );
- $args = array(
- 'labels' => $labels,
- 'public' => true,
- 'publicly_queryable' => true,
- 'show_ui' => true,
- 'rewrite' => true,
- 'query_var' => true,
- 'capability_type' => 'post',
- 'hierarchical' => false,
- 'show_in_nav_menus' => false,
- 'menu_position' => 1000,
- 'supports' => array(
- 'title',
- )
- );
- register_post_type('cd',$args);
- }
- /* Register Custom Post Type for Track */
- add_action('init', 'track_post_type_init');
- function track_post_type_init() {
- $labels = array(
- 'name' => _x('Track', 'post type general name'),
- 'singular_name' => _x('Track', 'post type singular name'),
- 'add_new' => _x('Add New', 'Track'),
- 'add_new_item' => __('Add New Track'),
- 'edit_item' => __('Edit Track'),
- 'new_item' => __('New Track'),
- 'view_item' => __('View Track'),
- 'search_items' => __('Search Tracks'),
- 'not_found' => __('No Tracks found'),
- 'not_found_in_trash' => __('No Tracks found in Trash'),
- 'parent_item_colon' => __('CD'),
- 'parent' => __('CD'),
- );
- $args = array(
- 'labels' => $labels,
- 'public' => true,
- 'publicly_queryable' => true,
- 'show_ui' => true, //false - to hide from the admin area menu
- 'rewrite' => true,
- 'query_var' => true,
- 'capability_type' => 'post',
- 'hierarchical' => true, //allow parent pages
- 'show_in_nav_menus' => false,
- 'menu_position' => 1000,
- 'supports' => array(
- 'title',
- 'page-attributes'
- )
- );
- register_post_type('track',$args);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement