Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function job_post_types() {
- register_post_type('job', array(
- 'rewrite' => array('slug' => 'jobs'),
- 'menu_icon' => 'dashicons-id-alt',
- 'has_archive' => true,
- 'public' => true,
- 'publicly_queryable' => true,
- 'supports' => array('title', 'editor', 'author', 'excerpt', 'custom-fields'),
- 'taxonomies' => array('job_type'), // we have used this from the taxonomies below. Default entry should be ('category', 'post_tag)
- 'labels' => array(
- 'name' => 'Jobs',
- 'add_new_item' => 'Add New Job',
- 'edit_item' => 'Edit Job',
- 'all_items' => 'All Jobs',
- 'singular_name' => 'Job'
- ),
- ));
- }
- add_action('init', 'job_post_types');
- function job_type_taxonomy(){
- $labels = array(
- 'name' => 'Job Types',
- 'singular_name' => 'Job Type',
- 'search_items' => 'Search Job Types',
- 'all_items' => 'All Job Types',
- 'parent_item' => 'Parent Job Type',
- 'parent_item_colon' => 'Parent Job Type:',
- 'edit_item' => 'Edit Job Type',
- 'update_item' => 'Update Job Type',
- 'add_new_item' => 'Add New Job Type',
- 'new_item_name' => 'New Job Type Name',
- 'menu_name' => 'Job Type',
- );
- $args = array(
- 'hierarchical' => true,
- 'labels' => $labels,
- 'show_ui' => true,
- 'show_admin_column' => true,
- 'query_var' => true,
- 'rewrite' => array( 'slug' => 'job_type' ),
- );
- register_taxonomy( 'job_type', array( 'job' ), $args );
- }
- add_action('init', 'job_type_taxonomy');
Add Comment
Please, Sign In to add comment