Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Adding Categories support to a Custom Post Type in WordPress. https://sridharkatakam.com/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