Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Adding Categories support to a Custom Post Type in WordPress.
//* Link e4gf_events CPT to categories taxonomy
add_action( 'init', 'sk_add_category_taxonomy_to_events' );
function sk_add_category_taxonomy_to_events() {
register_taxonomy_for_object_type( 'category', 'e4gf_events' );
'taxonomies' => array( 'category' ),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment