Advertisement
Guest User

Untitled

a guest
Sep 30th, 2014
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.59 KB | None | 0 0
  1. function custom_post_corpaku() {
  2. // creating (registering) the custom type
  3. register_post_type( 'corpaku', /* (http://codex.wordpress.org/Function_Reference/register_post_type) */
  4. // let's now add all the options for this post type
  5. array('labels' => array(
  6. 'name' => __('CORPAK U'), /* This is the Title of the Group */
  7. 'singular_name' => __('CORPAK U'), /* This is the individual type */
  8. 'all_items' => __('CORPAK U'), /* the all items menu item */
  9. 'add_new' => __('Add New CORPAK U'), /* The add new menu item */
  10. 'add_new_item' => __('Add New CORPAK U'), /* Add New Display Title */
  11. 'edit' => __( 'Edit'), /* Edit Dialog */
  12. 'edit_item' => __('Edit CORPAK U'), /* Edit Display Title */
  13. 'new_item' => __('New CORPAK U'), /* New Display Title */
  14. 'view_item' => __('View CORPAK U'), /* View Display Title */
  15. 'search_items' => __('Search CORPAK U'), /* Search Custom Type Title */
  16. 'not_found' => __('Nothing found in the Database.'), /* This displays if there are no entries yet */
  17. 'not_found_in_trash' => __('Nothing found in Trash'), /* This displays if there is nothing in the trash */
  18. 'parent_item_colon' => ''
  19. ), /* end of arrays */
  20. 'description' => __( 'This is the example custom post type CORPAK U' ), /* Custom Type Description */
  21. 'public' => true,
  22. 'publicly_queryable' => true,
  23. 'exclude_from_search' => false,
  24. 'show_ui' => true,
  25. 'query_var' => true,
  26. 'menu_position' => 7, /* this is what order you want it to appear in on the left hand side menu */
  27. 'menu_icon' => get_stylesheet_directory_uri() . '/library/images/custom-post-icon.png', /* the icon for the custom post type menu */
  28. 'rewrite' => array( 'slug' => 'corpaku', 'with_front' => false ), /* you can specify its url slug */
  29. 'has_archive' => true,
  30. 'capability_type' => 'post',
  31. 'hierarchical' => false,
  32. /* the next one is important, it tells what's enabled in the post editor */
  33. 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'sticky')
  34. ) /* end of options */
  35. ); /* end of register post type */
  36.  
  37. /* this adds your post categories to your custom post type */
  38. register_taxonomy_for_object_type('category', 'corpaku');
  39. /* this adds your post tags to your custom post type */
  40. register_taxonomy_for_object_type('post_tag', 'corpaku');
  41.  
  42. }
  43.  
  44. // adding the function to the Wordpress init
  45. add_action( 'init', 'custom_post_corpaku');
  46.  
  47. /*
  48. for more information on taxonomies, go here:
  49. http://codex.wordpress.org/Function_Reference/register_taxonomy
  50. */
  51.  
  52. // now let's add custom categories (these act like categories)
  53. register_taxonomy( 'corpaku_cat',
  54. array('corpaku'), /* if you change the name of register_post_type( 'custom_type', then you have to change this */
  55. array('hierarchical' => true, /* if this is true, it acts like categories */
  56. 'labels' => array(
  57. 'name' => __( 'CORPAK U Categories', 'awesome-theme' ), /* name of the custom taxonomy */
  58. 'singular_name' => __( 'CORPAK U Category', 'awesome-theme' ), /* single taxonomy name */
  59. 'search_items' => __( 'Search CORPAK U Categories', 'awesome-theme' ), /* search title for taxomony */
  60. 'all_items' => __( 'All CORPAK U Categories', 'awesome-theme' ), /* all title for taxonomies */
  61. 'parent_item' => __( 'Parent CORPAK U Category', 'awesome-theme' ), /* parent title for taxonomy */
  62. 'parent_item_colon' => __( 'Parent CORPAK U Category:', 'awesome-theme' ), /* parent taxonomy title */
  63. 'edit_item' => __( 'Edit CORPAK U Category', 'awesome-theme' ), /* edit custom taxonomy title */
  64. 'update_item' => __( 'Update CORPAK U Category', 'awesome-theme' ), /* update title for taxonomy */
  65. 'add_new_item' => __( 'Add New CORPAK U Category', 'awesome-theme' ), /* add new title for taxonomy */
  66. 'new_item_name' => __( 'New CORPAK U Category Name', 'awesome-theme' ) /* name title for taxonomy */
  67. ),
  68. 'show_admin_column' => true,
  69. 'show_ui' => true,
  70. 'query_var' => true,
  71. 'rewrite' => array( 'slug' => 'category-corpaku' ),
  72. )
  73. );
  74.  
  75. // now let's add custom tags (these act like categories)
  76. register_taxonomy( 'corpaku_tag',
  77. array('corpaku'), /* if you change the name of register_post_type( 'custom_type', then you have to change this */
  78. array('hierarchical' => false, /* if this is false, it acts like tags */
  79. 'labels' => array(
  80. 'name' => __( 'CORPAK U Tags', 'awesome-theme' ), /* name of the custom taxonomy */
  81. 'singular_name' => __( 'CORPAK U Tag', 'awesome-theme' ), /* single taxonomy name */
  82. 'search_items' => __( 'CORPAK U Custom Tags', 'awesome-theme' ), /* search title for taxomony */
  83. 'all_items' => __( 'All CORPAK U Tags', 'awesome-theme' ), /* all title for taxonomies */
  84. 'parent_item' => __( 'Parent CORPAK U Tag', 'awesome-theme' ), /* parent title for taxonomy */
  85. 'parent_item_colon' => __( 'Parent CORPAK U Tag:', 'awesome-theme' ), /* parent taxonomy title */
  86. 'edit_item' => __( 'Edit CORPAK U Tag', 'awesome-theme' ), /* edit custom taxonomy title */
  87. 'update_item' => __( 'Update CORPAK U Tag', 'awesome-theme' ), /* update title for taxonomy */
  88. 'add_new_item' => __( 'Add New CORPAK U Tag', 'awesome-theme' ), /* add new title for taxonomy */
  89. 'new_item_name' => __( 'New CORPAK U Tag Name', 'awesome-theme' ) /* name title for taxonomy */
  90. ),
  91. 'show_admin_column' => true,
  92. 'show_ui' => true,
  93. 'query_var' => true,
  94. )
  95. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement