Search code examples
wordpresscustom-post-typetaxonomycustom-taxonomy

Global taxonomy in WordPress


I want to use a taxonomy for all my custom post types. Is this possible with the taxonomies in WordPress?

Let's say I've an owm custom post type for movies, games and music. Now I want to add the taxomomy "genre" to all of them to build an archive page to display all custom post types for the genre.


Solution

  • Ah, I think I've found it. I can comma seperate the post types like this:

    register_taxonomy( 'genre', array( 'post', ' page' ), $args );