0
votes

I am new with wordpress.

i have created three "custom post" type like

  1. Two Wheeler
  2. Three Wheeler
  3. Four Wheeeler

I have used the following code to create custom post type in admin.

function create_post_type_two_wheeler()
{
    register_taxonomy_for_object_type('category', 'TwoWheeler'); // Register Taxonomies for Category
    register_taxonomy_for_object_type('post_tag', 'TwoWheeler');
    register_post_type('client', // Register Custom Post Type
        array(
            'labels' => array(
                'name' => __('TwoWheeler', 'vehicles'), // Rename these to suit
                'singular_name' => __('TwoWheeler', 'vehicles'),
                'add_new' => __('Add New', 'vehicles'),
                'add_new_item' => __('Add New TwoWheeler', 'vehicles'),
                'edit' => __('Edit', 'vehicles'),
                'edit_item' => __('Edit TwoWheeler', 'vehicles'),
                'new_item' => __('New TwoWheeler', 'vehicles'),
                'view' => __('View TwoWheeler', 'vehicles'),
                'view_item' => __('View TwoWheeler', 'vehicles'),
                'search_items' => __('Search TwoWheeler', 'vehicles'),
                'not_found' => __('No TwoWheeler found', 'vehicles'),
                'not_found_in_trash' => __('No TwoWheeler found in Trash', 'vehicles')
            ),
            'public' => true,
            'hierarchical' => true, // Allows your posts to behave like Hierarchy Pages
            'has_archive' => true,
            'supports' => array(
                'title',
                'editor',
                'excerpt',
                'thumbnail'
            ), // Go to Dashboard Custom HTML5 Blank post for supports
            'can_export' => true, // Allows export in Tools > Export
            'taxonomies' => array(
                'post_tag',
                'category'
            ) // Add Category and Post Tags support
        ));

}

add_action('init', 'create_post_type_two_wheeler');

Now i want to display Dropdown in admin Add/Edit post of "Two wheeler" custom post type.so user can select that option for that particular post and save that option in database.

Any google link that will help me to do this ?? i Need a way to start work on this.

1

1 Answers

0
votes

I'm not sure that I fully understand the question, but if you want to add metabox for your custom post types, then you could look at this script: WPAlchemy MetaBox