0
votes

I'm using the Convert Post Types plugin, this plugin works without any problem but the problem is that when I convert all the post to my custom post type they lose all categories leaving without any category. https://wordpress.org/plugins/convert-post-types/

I have selected both categories before converting posts to custom post type, but doing so all posts converted to custom post type appear with all categories selected in my custom post type.

I have created both categories with the same slug and name tando in posts as in custom post type.

How can I make all my posts converted to post type cusmtom appear in the categories of my custom post type?

I have about 16,000 posts.

1

1 Answers

2
votes

where you regusterd the custom post type in your themes functions.php or in a plugin file add one more paramter in it.

'taxonomies'          => array( 'category' )

sample code here

function team_create_post_type() {

    $labels = array(
        'name' => __('Team', 'twentyfifteen'),
        'singular_name' => __('Team', 'twentyfifteen'),
        'add_new' => __('Add New', 'twentyfifteen'),
        'add_new_item' => __('Add New Team', 'twentyfifteen'),
        'edit_item' => __('Edit Team', 'twentyfifteen'),
        'new_item' => __('New Team', 'twentyfifteen'),
        'all_items' => __('All Team', 'twentyfifteen'),
        'view_item' => __('View Team', 'twentyfifteen'),
        'search_items' => __('Search Team', 'twentyfifteen'),
        'not_found' => __('No team found', 'twentyfifteen'),
        'not_found_in_trash' => __('No team found in Trash', 'twentyfifteen'),
        'parent_item_colon' => '',
        'menu_name' => __('Team', 'twentyfifteen'),

    );
    register_post_type(
        'team',
        array(
            'labels' => $labels,
            'supports' => array('title', 'editor', 'thumbnail', 'comments', 'author'),
            'public' => TRUE,
            'query_var'=>TRUE,
            'publicly_queryable'=>TRUE,
            'has_archive' => TRUE,
            'rewrite' => array('slug' => __('team', 'twentyfifteen')),
            'menu_position' => 32,
            'taxonomies'          => array( 'category' )
        )
    );
}
add_action('init', 'team_create_post_type');

after that you can use post type changer plugin