// in theme/functions.php
add_action('init', 'jtd_custom_post_types');
function jtd_custom_post_types() {
$labels = array(
'name' => _x('Cards', 'post type general name'),
'singular_name' => _x('Card', 'post type singular name'),
'add_new' => _x('Add New', 'card'),
'add_new_item' => __('Add New Card'),
'edit_item' => __('Edit Card'),
'new_item' => __('New Card'),
'view_item' => __('View Card'),
'search_items' => __('Search Cards'),
'not_found' => __('No cards found'),
'not_found_in_trash' => __('No cards found in Trash'),
'parent_item_colon' => ''
);
$args = array(
'labels' => $labels,
'menu_position' => 30,
'public' => true,
'query_var' => true,
'supports' => array( 'title', 'editor', 'comments', 'revisions', 'author', 'excerpt', 'custom-fields', 'page-attributes', 'thumbnail' ),
'rewrite' => array( 'slug' => 'provider', 'with_front' => false ),
'taxonomies' => array( 'post_tag', 'category'),
);
register_post_type('card',$args);
};
// This function tells WP to add a new "meta box"
function add_some_box() {
add_meta_box(
'ozh', // id of the <div> we'll add
'My Box', //title
'add_something_in_the_box', // callback function that will echo the box content
'card' // where to add the box: on "post", "page", or "link" page
);
}
// This function echoes the content of our meta box
function add_something_in_the_box() {
echo "I'm living in a box";
}
// Hook things in, late enough so that add_meta_box() is defined
if (is_admin())
add_action('admin_menu', 'add_some_box');