Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function custom_post_corpaku() {
- // creating (registering) the custom type
- register_post_type( 'corpaku', /* (http://codex.wordpress.org/Function_Reference/register_post_type) */
- // let's now add all the options for this post type
- array('labels' => array(
- 'name' => __('CORPAK U'), /* This is the Title of the Group */
- 'singular_name' => __('CORPAK U'), /* This is the individual type */
- 'all_items' => __('CORPAK U'), /* the all items menu item */
- 'add_new' => __('Add New CORPAK U'), /* The add new menu item */
- 'add_new_item' => __('Add New CORPAK U'), /* Add New Display Title */
- 'edit' => __( 'Edit'), /* Edit Dialog */
- 'edit_item' => __('Edit CORPAK U'), /* Edit Display Title */
- 'new_item' => __('New CORPAK U'), /* New Display Title */
- 'view_item' => __('View CORPAK U'), /* View Display Title */
- 'search_items' => __('Search CORPAK U'), /* Search Custom Type Title */
- 'not_found' => __('Nothing found in the Database.'), /* This displays if there are no entries yet */
- 'not_found_in_trash' => __('Nothing found in Trash'), /* This displays if there is nothing in the trash */
- 'parent_item_colon' => ''
- ), /* end of arrays */
- 'description' => __( 'This is the example custom post type CORPAK U' ), /* Custom Type Description */
- 'public' => true,
- 'publicly_queryable' => true,
- 'exclude_from_search' => false,
- 'show_ui' => true,
- 'query_var' => true,
- 'menu_position' => 7, /* this is what order you want it to appear in on the left hand side menu */
- 'menu_icon' => get_stylesheet_directory_uri() . '/library/images/custom-post-icon.png', /* the icon for the custom post type menu */
- 'rewrite' => array( 'slug' => 'corpaku', 'with_front' => false ), /* you can specify its url slug */
- 'has_archive' => true,
- 'capability_type' => 'post',
- 'hierarchical' => false,
- /* the next one is important, it tells what's enabled in the post editor */
- 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'sticky')
- ) /* end of options */
- ); /* end of register post type */
- /* this adds your post categories to your custom post type */
- register_taxonomy_for_object_type('category', 'corpaku');
- /* this adds your post tags to your custom post type */
- register_taxonomy_for_object_type('post_tag', 'corpaku');
- }
- // adding the function to the Wordpress init
- add_action( 'init', 'custom_post_corpaku');
- /*
- for more information on taxonomies, go here:
- http://codex.wordpress.org/Function_Reference/register_taxonomy
- */
- // now let's add custom categories (these act like categories)
- register_taxonomy( 'corpaku_cat',
- array('corpaku'), /* if you change the name of register_post_type( 'custom_type', then you have to change this */
- array('hierarchical' => true, /* if this is true, it acts like categories */
- 'labels' => array(
- 'name' => __( 'CORPAK U Categories', 'awesome-theme' ), /* name of the custom taxonomy */
- 'singular_name' => __( 'CORPAK U Category', 'awesome-theme' ), /* single taxonomy name */
- 'search_items' => __( 'Search CORPAK U Categories', 'awesome-theme' ), /* search title for taxomony */
- 'all_items' => __( 'All CORPAK U Categories', 'awesome-theme' ), /* all title for taxonomies */
- 'parent_item' => __( 'Parent CORPAK U Category', 'awesome-theme' ), /* parent title for taxonomy */
- 'parent_item_colon' => __( 'Parent CORPAK U Category:', 'awesome-theme' ), /* parent taxonomy title */
- 'edit_item' => __( 'Edit CORPAK U Category', 'awesome-theme' ), /* edit custom taxonomy title */
- 'update_item' => __( 'Update CORPAK U Category', 'awesome-theme' ), /* update title for taxonomy */
- 'add_new_item' => __( 'Add New CORPAK U Category', 'awesome-theme' ), /* add new title for taxonomy */
- 'new_item_name' => __( 'New CORPAK U Category Name', 'awesome-theme' ) /* name title for taxonomy */
- ),
- 'show_admin_column' => true,
- 'show_ui' => true,
- 'query_var' => true,
- 'rewrite' => array( 'slug' => 'category-corpaku' ),
- )
- );
- // now let's add custom tags (these act like categories)
- register_taxonomy( 'corpaku_tag',
- array('corpaku'), /* if you change the name of register_post_type( 'custom_type', then you have to change this */
- array('hierarchical' => false, /* if this is false, it acts like tags */
- 'labels' => array(
- 'name' => __( 'CORPAK U Tags', 'awesome-theme' ), /* name of the custom taxonomy */
- 'singular_name' => __( 'CORPAK U Tag', 'awesome-theme' ), /* single taxonomy name */
- 'search_items' => __( 'CORPAK U Custom Tags', 'awesome-theme' ), /* search title for taxomony */
- 'all_items' => __( 'All CORPAK U Tags', 'awesome-theme' ), /* all title for taxonomies */
- 'parent_item' => __( 'Parent CORPAK U Tag', 'awesome-theme' ), /* parent title for taxonomy */
- 'parent_item_colon' => __( 'Parent CORPAK U Tag:', 'awesome-theme' ), /* parent taxonomy title */
- 'edit_item' => __( 'Edit CORPAK U Tag', 'awesome-theme' ), /* edit custom taxonomy title */
- 'update_item' => __( 'Update CORPAK U Tag', 'awesome-theme' ), /* update title for taxonomy */
- 'add_new_item' => __( 'Add New CORPAK U Tag', 'awesome-theme' ), /* add new title for taxonomy */
- 'new_item_name' => __( 'New CORPAK U Tag Name', 'awesome-theme' ) /* name title for taxonomy */
- ),
- 'show_admin_column' => true,
- 'show_ui' => true,
- 'query_var' => true,
- )
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement