I am using an automation solution to pull my videos into a category. It seems the automation solution cannot account for custom post types and custom post type categories, so I'm having to send all of my video content to a normal category. How can I still take advantage of my theme's custom post types?

Is there a way I could do some hard wiring? Or is there a plugin that will help me connect the two?


This is as far as I was able to get with automating the solution programatically (but you can see, this depends on the taxonomy name of the custom-post-type-category being standardized as 'taxonomy_uniquename'):

//insert rss item into database store   
$post = array(      
    'post_author' => $campaign_author[$key],
    'post_category' => $cat, 
    'post_content' => $description, 
    'post_date' => $date_placeholder,
    'post_date_gmt' => $gmt_date,
    'post_name' => $permalink_name,
    'post_status' => $post_status, 
    'post_title' => $title,
    'post_type' => $campaign_post_type[$key],
    'tags_input' => "$tags",
    'original_source'=> $link
$post_id = wp_insert_post( $post, $wp_error );

//echo $wp_error; exit;
if ($campaign_post_type[$key]!='post'||$campaign_post_type[$key]!='page') {
  • Without code there's not much to think around. How does the automation solution work? What functions does it use to do what it does?
    – soulseekah
    Oct 18, 2011 at 5:38

1 Answer 1


If you need to register the built in category taxonomy for a custom post type you can do this by using the priority argument when adding an init action hook.

add_action( 'init', 'add_category_to_post_types', 11 );
function add_category_to_post_types() {
   register_taxonomy_for_object_type( 'category', 'my_post_type' );

The third argument in the add_action() call sets a priority so most things in wordpress will occur at the default priority of 10. By setting this to 11 your custom post type should be registered and the built in taxonomies will definitely be registered so you can add to your post type.

If that doesn't work you need to check the priority of the action hook in which your post type is registered and set the number 11 above to something higher than that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.