|
@@ -5,7 +5,7 @@ a custom post type and taxonomies. You
|
|
|
can edit this one or copy the following code
|
|
can edit this one or copy the following code
|
|
|
to create another one.
|
|
to create another one.
|
|
|
|
|
|
|
|
-I put this in a seperate file so as to
|
|
|
|
|
|
|
+I put this in a separate file so as to
|
|
|
keep it organized. I find it easier to edit
|
|
keep it organized. I find it easier to edit
|
|
|
and change things if they are concentrated
|
|
and change things if they are concentrated
|
|
|
in their own file.
|
|
in their own file.
|
|
@@ -21,21 +21,21 @@ function custom_post_example() {
|
|
|
register_post_type( 'custom_type', /* (http://codex.wordpress.org/Function_Reference/register_post_type) */
|
|
register_post_type( 'custom_type', /* (http://codex.wordpress.org/Function_Reference/register_post_type) */
|
|
|
// let's now add all the options for this post type
|
|
// let's now add all the options for this post type
|
|
|
array('labels' => array(
|
|
array('labels' => array(
|
|
|
- 'name' => __('Custom Types', 'post type general name'), /* This is the Title of the Group */
|
|
|
|
|
- 'singular_name' => __('Custom Post', 'post type singular name'), /* This is the individual type */
|
|
|
|
|
- 'all_items' => __('All Custom Posts'), /* the all items menu item */
|
|
|
|
|
- 'add_new' => __('Add New', 'custom post type item'), /* The add new menu item */
|
|
|
|
|
- 'add_new_item' => __('Add New Custom Type'), /* Add New Display Title */
|
|
|
|
|
- 'edit' => __( 'Edit' ), /* Edit Dialog */
|
|
|
|
|
- 'edit_item' => __('Edit Post Types'), /* Edit Display Title */
|
|
|
|
|
- 'new_item' => __('New Post Type'), /* New Display Title */
|
|
|
|
|
- 'view_item' => __('View Post Type'), /* View Display Title */
|
|
|
|
|
- 'search_items' => __('Search Post Type'), /* 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 */
|
|
|
|
|
|
|
+ 'name' => __('Custom Types', 'bonestheme'), /* This is the Title of the Group */
|
|
|
|
|
+ 'singular_name' => __('Custom Post', 'bonestheme'), /* This is the individual type */
|
|
|
|
|
+ 'all_items' => __('All Custom Posts', 'bonestheme'), /* the all items menu item */
|
|
|
|
|
+ 'add_new' => __('Add New', 'bonestheme'), /* The add new menu item */
|
|
|
|
|
+ 'add_new_item' => __('Add New Custom Type', 'bonestheme'), /* Add New Display Title */
|
|
|
|
|
+ 'edit' => __( 'Edit', 'bonestheme' ), /* Edit Dialog */
|
|
|
|
|
+ 'edit_item' => __('Edit Post Types', 'bonestheme'), /* Edit Display Title */
|
|
|
|
|
+ 'new_item' => __('New Post Type', 'bonestheme'), /* New Display Title */
|
|
|
|
|
+ 'view_item' => __('View Post Type', 'bonestheme'), /* View Display Title */
|
|
|
|
|
+ 'search_items' => __('Search Post Type', 'bonestheme'), /* Search Custom Type Title */
|
|
|
|
|
+ 'not_found' => __('Nothing found in the Database.', 'bonestheme'), /* This displays if there are no entries yet */
|
|
|
|
|
+ 'not_found_in_trash' => __('Nothing found in Trash', 'bonestheme'), /* This displays if there is nothing in the trash */
|
|
|
'parent_item_colon' => ''
|
|
'parent_item_colon' => ''
|
|
|
), /* end of arrays */
|
|
), /* end of arrays */
|
|
|
- 'description' => __( 'This is the example custom post type' ), /* Custom Type Description */
|
|
|
|
|
|
|
+ 'description' => __( 'This is the example custom post type', 'bonestheme' ), /* Custom Type Description */
|
|
|
'public' => true,
|
|
'public' => true,
|
|
|
'publicly_queryable' => true,
|
|
'publicly_queryable' => true,
|
|
|
'exclude_from_search' => false,
|
|
'exclude_from_search' => false,
|
|
@@ -72,16 +72,16 @@ function custom_post_example() {
|
|
|
array('custom_type'), /* if you change the name of register_post_type( 'custom_type', then you have to change this */
|
|
array('custom_type'), /* 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 */
|
|
array('hierarchical' => true, /* if this is true it acts like categories */
|
|
|
'labels' => array(
|
|
'labels' => array(
|
|
|
- 'name' => __( 'Custom Categories' ), /* name of the custom taxonomy */
|
|
|
|
|
- 'singular_name' => __( 'Custom Category' ), /* single taxonomy name */
|
|
|
|
|
- 'search_items' => __( 'Search Custom Categories' ), /* search title for taxomony */
|
|
|
|
|
- 'all_items' => __( 'All Custom Categories' ), /* all title for taxonomies */
|
|
|
|
|
- 'parent_item' => __( 'Parent Custom Category' ), /* parent title for taxonomy */
|
|
|
|
|
- 'parent_item_colon' => __( 'Parent Custom Category:' ), /* parent taxonomy title */
|
|
|
|
|
- 'edit_item' => __( 'Edit Custom Category' ), /* edit custom taxonomy title */
|
|
|
|
|
- 'update_item' => __( 'Update Custom Category' ), /* update title for taxonomy */
|
|
|
|
|
- 'add_new_item' => __( 'Add New Custom Category' ), /* add new title for taxonomy */
|
|
|
|
|
- 'new_item_name' => __( 'New Custom Category Name' ) /* name title for taxonomy */
|
|
|
|
|
|
|
+ 'name' => __( 'Custom Categories', 'bonestheme' ), /* name of the custom taxonomy */
|
|
|
|
|
+ 'singular_name' => __( 'Custom Category', 'bonestheme' ), /* single taxonomy name */
|
|
|
|
|
+ 'search_items' => __( 'Search Custom Categories', 'bonestheme' ), /* search title for taxomony */
|
|
|
|
|
+ 'all_items' => __( 'All Custom Categories', 'bonestheme' ), /* all title for taxonomies */
|
|
|
|
|
+ 'parent_item' => __( 'Parent Custom Category', 'bonestheme' ), /* parent title for taxonomy */
|
|
|
|
|
+ 'parent_item_colon' => __( 'Parent Custom Category:', 'bonestheme' ), /* parent taxonomy title */
|
|
|
|
|
+ 'edit_item' => __( 'Edit Custom Category', 'bonestheme' ), /* edit custom taxonomy title */
|
|
|
|
|
+ 'update_item' => __( 'Update Custom Category', 'bonestheme' ), /* update title for taxonomy */
|
|
|
|
|
+ 'add_new_item' => __( 'Add New Custom Category', 'bonestheme' ), /* add new title for taxonomy */
|
|
|
|
|
+ 'new_item_name' => __( 'New Custom Category Name', 'bonestheme' ) /* name title for taxonomy */
|
|
|
),
|
|
),
|
|
|
'show_ui' => true,
|
|
'show_ui' => true,
|
|
|
'query_var' => true,
|
|
'query_var' => true,
|
|
@@ -93,16 +93,16 @@ function custom_post_example() {
|
|
|
array('custom_type'), /* if you change the name of register_post_type( 'custom_type', then you have to change this */
|
|
array('custom_type'), /* 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 */
|
|
array('hierarchical' => false, /* if this is false, it acts like tags */
|
|
|
'labels' => array(
|
|
'labels' => array(
|
|
|
- 'name' => __( 'Custom Tags' ), /* name of the custom taxonomy */
|
|
|
|
|
- 'singular_name' => __( 'Custom Tag' ), /* single taxonomy name */
|
|
|
|
|
- 'search_items' => __( 'Search Custom Tags' ), /* search title for taxomony */
|
|
|
|
|
- 'all_items' => __( 'All Custom Tags' ), /* all title for taxonomies */
|
|
|
|
|
- 'parent_item' => __( 'Parent Custom Tag' ), /* parent title for taxonomy */
|
|
|
|
|
- 'parent_item_colon' => __( 'Parent Custom Tag:' ), /* parent taxonomy title */
|
|
|
|
|
- 'edit_item' => __( 'Edit Custom Tag' ), /* edit custom taxonomy title */
|
|
|
|
|
- 'update_item' => __( 'Update Custom Tag' ), /* update title for taxonomy */
|
|
|
|
|
- 'add_new_item' => __( 'Add New Custom Tag' ), /* add new title for taxonomy */
|
|
|
|
|
- 'new_item_name' => __( 'New Custom Tag Name' ) /* name title for taxonomy */
|
|
|
|
|
|
|
+ 'name' => __( 'Custom Tags', 'bonestheme' ), /* name of the custom taxonomy */
|
|
|
|
|
+ 'singular_name' => __( 'Custom Tag', 'bonestheme' ), /* single taxonomy name */
|
|
|
|
|
+ 'search_items' => __( 'Search Custom Tags', 'bonestheme' ), /* search title for taxomony */
|
|
|
|
|
+ 'all_items' => __( 'All Custom Tags', 'bonestheme' ), /* all title for taxonomies */
|
|
|
|
|
+ 'parent_item' => __( 'Parent Custom Tag', 'bonestheme' ), /* parent title for taxonomy */
|
|
|
|
|
+ 'parent_item_colon' => __( 'Parent Custom Tag:', 'bonestheme' ), /* parent taxonomy title */
|
|
|
|
|
+ 'edit_item' => __( 'Edit Custom Tag', 'bonestheme' ), /* edit custom taxonomy title */
|
|
|
|
|
+ 'update_item' => __( 'Update Custom Tag', 'bonestheme' ), /* update title for taxonomy */
|
|
|
|
|
+ 'add_new_item' => __( 'Add New Custom Tag', 'bonestheme' ), /* add new title for taxonomy */
|
|
|
|
|
+ 'new_item_name' => __( 'New Custom Tag Name', 'bonestheme' ) /* name title for taxonomy */
|
|
|
),
|
|
),
|
|
|
'show_ui' => true,
|
|
'show_ui' => true,
|
|
|
'query_var' => true,
|
|
'query_var' => true,
|