Guest User

Untitled

a guest
Jan 10th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. function job_post_types() {
  2. register_post_type('job', array(
  3. 'rewrite' => array('slug' => 'jobs'),
  4. 'menu_icon' => 'dashicons-id-alt',
  5. 'has_archive' => true,
  6. 'public' => true,
  7. 'publicly_queryable' => true,
  8. 'supports' => array('title', 'editor', 'author', 'excerpt', 'custom-fields'),
  9. 'taxonomies' => array('job_type'), // we have used this from the taxonomies below. Default entry should be ('category', 'post_tag)
  10.  
  11. 'labels' => array(
  12. 'name' => 'Jobs',
  13. 'add_new_item' => 'Add New Job',
  14. 'edit_item' => 'Edit Job',
  15. 'all_items' => 'All Jobs',
  16. 'singular_name' => 'Job'
  17. ),
  18. ));
  19. }
  20.  
  21. add_action('init', 'job_post_types');
  22.  
  23.  
  24. function job_type_taxonomy(){
  25.  
  26. $labels = array(
  27. 'name' => 'Job Types',
  28. 'singular_name' => 'Job Type',
  29. 'search_items' => 'Search Job Types',
  30. 'all_items' => 'All Job Types',
  31. 'parent_item' => 'Parent Job Type',
  32. 'parent_item_colon' => 'Parent Job Type:',
  33. 'edit_item' => 'Edit Job Type',
  34. 'update_item' => 'Update Job Type',
  35. 'add_new_item' => 'Add New Job Type',
  36. 'new_item_name' => 'New Job Type Name',
  37. 'menu_name' => 'Job Type',
  38. );
  39.  
  40. $args = array(
  41. 'hierarchical' => true,
  42. 'labels' => $labels,
  43. 'show_ui' => true,
  44. 'show_admin_column' => true,
  45. 'query_var' => true,
  46. 'rewrite' => array( 'slug' => 'job_type' ),
  47. );
  48.  
  49. register_taxonomy( 'job_type', array( 'job' ), $args );
  50. }
  51.  
  52. add_action('init', 'job_type_taxonomy');
Add Comment
Please, Sign In to add comment