Skip to content

Instantly share code, notes, and snippets.

@srikat
Last active August 16, 2016 12:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save srikat/70923da7e5e3225c490a to your computer and use it in GitHub Desktop.
Save srikat/70923da7e5e3225c490a to your computer and use it in GitHub Desktop.
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