Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function cb_result_custom_post() {
- // Register Custom Post
- register_post_type( 'results',
- array(
- 'labels' => array(
- 'name' => __( 'Results' ),
- 'singular_name' => __( 'Result' ),
- 'add_new' => __( 'Add New' ),
- 'add_new_item' => __( 'Add New Result' ),
- 'edit_item' => __( 'Edit Result' ),
- 'new_item' => __( 'New Result' ),
- 'view_item' => __( 'View Result' ),
- 'not_found' => __( 'Sorry, we couldn\'t find the Result you are looking for.' )
- ),
- 'public' => true,
- 'publicly_queryable' => false,
- 'exclude_from_search' => true,
- 'menu_position' => 14,
- 'has_archive' => true,
- 'hierarchical' => false,
- 'capability_type' => 'page',
- 'rewrite' => array( 'slug' => 'cb_result' ),
- 'supports' => array( 'title', 'editor', 'custom-fields', 'thumbnail' )
- )
- );
- //Register Custom Taxonomy
- register_taxonomy(
- 'cb_result_year', //The name of the taxonomy. Name should be in slug form (must not contain capital letters or spaces).
- 'results', //post type name
- array(
- 'hierarchical' => true,
- 'label' => 'Years', //Display name
- 'query_var' => true,
- 'show_admin_column' => true,
- 'rewrite' => array(
- 'slug' => 'cb_result_year', // This controls the base slug that will display before each term
- 'with_front' => true // Don't display the category base before
- )
- )
- );
- register_taxonomy(
- 'cb_result_class', //The name of the taxonomy. Name should be in slug form (must not contain capital letters or spaces).
- 'results', //post type name
- array(
- 'hierarchical' => true,
- 'label' => 'Class', //Display name
- 'query_var' => true,
- 'show_admin_column' => true,
- 'rewrite' => array(
- 'slug' => 'cb_result_class', // This controls the base slug that will display before each term
- 'with_front' => true // Don't display the category base before
- )
- )
- );
- register_taxonomy(
- 'cb_result_semester', //The name of the taxonomy. Name should be in slug form (must not contain capital letters or spaces).
- 'results', //post type name
- array(
- 'hierarchical' => true,
- 'label' => 'Semester', //Display name
- 'query_var' => true,
- 'show_admin_column' => true,
- 'rewrite' => array(
- 'slug' => 'cb_result_semester', // This controls the base slug that will display before each term
- 'with_front' => true // Don't display the category base before
- )
- )
- );
- }
- add_action( 'init', 'cb_result_custom_post' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement