0

I am trying to add post tags to the custom post types bbpress creates, so that I can do some "related topics" kind of stuff.

Is there a function that adds a post support like 'taxonomies' => array('post_tag'), but to a post type that was previously created?

My thought was I could just re create the custom post type on theme install or soemthing and hope it didnt mess anything up, but I really wanted to avoid doing that.

1

Use the function register_taxonomy_for_object_type to add existing taxonomies to existing post types:

function wpa_tags_for_cpt(){
    register_taxonomy_for_object_type( 'post_tag', 'post_type_name' );
}
add_action( 'init', 'wpa_tags_for_cpt', 999 );

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.