-
-
Save theperfectwill/6132cf4ae41b7aefec835e6712ac3d51 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/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* 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' ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'taxonomies' => array( 'category' ), |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment