Hot answers tagged posts
Alternatively to Kaiser's answer, when you register the post type, simply use the taxonomies attribute: register_post_type( 'my-cpt', array( ... 'taxonomies' => array( 'category' ), ... ) ); Details on register_post_type() can be found here in Codex.
Additional info for @StephenHarris answer: When you register a taxonomy and a post type and want to connect them, there's one important rule: Always register the taxonomy first. Then register the post type. The reason is simple: Take a look at the source of register_taxonomy(): // Adds the 2nd argument ($object_type) to the arguments: ...
It could be because you are not supplying post id in time parameter function. In place of the_time('d F') try using echo get_the_time('d F'm $post->ID) because it will give you the flexibility to supply post id when you are in a loop. Reference: get_the_time Codex EDIT My bad, I guess $post variables are not being set by your method. I have designed ...
When your taxonomy is already registered (or is a built-in one like post tags, categories, etc.), you can simply glue it to a post type by using register_taxonomy_for_object_type(): register_taxonomy_for_object_type( 'category', 'course' ); Just make sure you do that after both the taxonomy and the post type are already registered.
Only top voted, non community-wiki answers of a minimum length are eligible