Guest User

Untitled

a guest
Dec 12th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. add_action( 'init', 'work_register' );
  2.  
  3. function work_register() {
  4.  
  5. $labels = array(
  6. 'name' => _x('Work', 'post type general name'),
  7. 'singular_name' => _x('Work Item', 'post type singular name'),
  8. 'add_new' => _x('Add New', 'work item'),
  9. 'add_new_item' => __('Add New Work Item'),
  10. 'edit_item' => __('Edit Work Item'),
  11. 'new_item' => __('New Work Item'),
  12.  
  13. 'view_item' => __('View Work Item'),
  14. 'search_items' => __('Search Work'),
  15. 'not_found' => __('Nothing found'),
  16. 'not_found_in_trash' => __('Nothing found in Trash'),
  17. 'parent_item_colon' => ''
  18. );
  19.  
  20. $args = array(
  21. 'labels' => $labels,
  22. 'public' => true,
  23. 'publicly_queryable' => true,
  24. 'show_ui' => true,
  25. 'query_var' => true,
  26. 'menu_icon' => get_stylesheet_directory_uri() . '/article16.png',
  27. 'rewrite' => array( 'slug' => 'work', 'with_front'=> false ),
  28. 'capability_type' => 'post',
  29. 'hierarchical' => true,
  30. 'has_archive' => true,
  31. 'menu_position' => null,
  32. 'supports' => array('title','editor','thumbnail')
  33. );
  34.  
  35. register_post_type( 'work' , $args );
  36.  
  37. register_taxonomy( 'categories', array('work'), array(
  38. 'hierarchical' => true,
  39. 'label' => 'Categories',
  40. 'singular_label' => 'Category',
  41. 'rewrite' => array( 'slug' => 'categories', 'with_front'=> false )
  42. )
  43. );
  44.  
  45. register_taxonomy_for_object_type( 'categories', 'work' );
  46.  
  47. /%category%/%postname%/
  48.  
  49. /category/postname
  50.  
  51. /postname
Add Comment
Please, Sign In to add comment