0

I'm having some problems adding custom taxonomies to my custom post. I've already created the custom post like this:

add_action( 'init', 'create_post_type' );
function create_post_type() {
register_post_type( 'profiel_pagina',
    array(
        'labels' => array(
            'name' => __( 'Profiel pagina' ),
            'singular_name' => __( 'Profiel pagina' )
        ),
    'public' => true,
    'has_archive' => true,
    'supports'   => array('title', 'editor', 'thumbnail')
    )
);

And the custom taxonomies like this:

function create_my_taxonomies() {
register_taxonomy('vakgebied', 'post', array(
'hierarchical' => false, 'label' => 'Vakgebied',
'query_var' => true, 'rewrite' => true));
}register_taxonomy('specialisatie', 'post', array(
'hierarchical' => false, 'label' => 'Specialisatie',
'query_var' => true, 'rewrite' => true));
 }
add_action('init', 'create_my_taxonomies', 0);

This is all fine but how can I connect these two with each other? Using 'taxonomies' => array('post-tag') doesn't work. Also using 'post' when adding the custom taxonomies isn't the right way to do it according to the codex but how should I do it then?

Any help is much appreciated.

NielsPilon
  • 500
  • 2
  • 7
  • 21

1 Answers1

0

You are currently adding your taxonomies to the post content type. You want to add them to profiel_pagina so you would use register_taxonomy('vakgebied', 'profiel_pagina', array(...));

Rob
  • 12,659
  • 4
  • 39
  • 56