• Hi,

    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.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘adding custom taxonomies to a custom post’ is closed to new replies.