Use register_taxonomy() in register_activation_hook()

I would like to use register_taxonomy() to define a hierarchy of geographical terms. It seems that the natural place to place it would be in a function called by register_activation_hook() seeing how the taxonomy needs only to be defined once. However, the fine manual explicitly states to “use the init action to call this function”. … Read more

What does query_var do in register_taxonomy

What happens if in register_taxonomy( $taxonomy, $object_type, $args ) I set query_var arguement to true? I read here this query_var (boolean or string) (optional) False to disable the query_var, set as string to use custom query_var instead of default which is $taxonomy, the taxonomy’s “name”. Default: $taxonomy Note: The query_var is used for direct queries … Read more

Add multiple custom post types in functions.php, but only one custom post type show in dashboard

I am new to wordpress, and I am trying to add multiple custom post types in the functions.php. Adding one cpt is fine. but if I use the same function to add the second cpt (with just a change of the function name), the second cpt doesn’t show in the dashboard menu. Below are the … Read more

Custom taxonomies, with custom rewrites/slug, AND loading a taxonomy archive template from a plugin

I think maybe my understanding about rewrites and templates for custom taxonomies and CPTs is wrong and maybe someone here could help me solve my problem and educate me. So I have a post type, “wiki-doc” and a post type “wiki-news”. Each has been set up with custom slugs: wiki-doc has its rewrite set to: … Read more

How can I fix those issues generated by the Themecheck plugin

I’ve got the following error messages on the themecheck plugin in my WordPress theme. REQUIRED: The theme uses the register_taxonomy() function, which is plugin-territory functionality. REQUIRED: The theme uses the register_post_type() function, which is plugin-territory functionality. WARNING: The theme uses the add_shortcode() function. Custom post-content shortcodes are plugin-territory functionality. I declared the register_taxonomy() and register_post_type() … Read more

Registering custom taxonomy with unique name, a good practise?

Is it a good practise to register custom taxonomy with a unique name (the $taxonomy parameter), and then use the rewrite argument to set a custom slug? For example, I could create a taxonomy called list in two different ways. Like this: add_action( ‘init’, ‘custom_taxonomy_lists’ ); function custom_taxonomy_lists() { register_taxonomy( ‘lists’, // […] ); } … Read more

How to modify a taxonomy that’s already registered

Today I needed to change the arguments on a custom taxonomy that was already registered by a third party plugin. Specifically I wanted to set the show_admin_column argument to true and change the rewrite slug so that it wasn’t just the taxonomy slug. In this case, it was a “People” post type with a “People … Read more