WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Custom taxonomy somehow is not being added (2 posts)

  1. rreimche
    Member
    Posted 1 year ago #

    Hi all.

    I've got a custom post type called "gallery" and I want to add a taxonomy called "gal_categories" to this type.

    So I do the following:

    function gallery_register() {
    
            $args = array(/*here go args*/);
    
           register_post_type( 'gallery' , $args );
    
    	register_taxonomy("gal_categories", array("gallery"),array("hierarchical" => true, "label" => "Something", "singular_label" => "Something", "rewrite" => true ));
    
    }
    
    add_action('init','gallery_register');

    Well, the custom post type works flowlessly, but I have no taxonomy I added. And that's kind of strange...

    In fact I also have another custom post type with a taxonomy and it works just the same way: there is working post type but no taxonomy.

    What could it be?

  2. rreimche
    Member
    Posted 1 year ago #

    The problem was in name conflict with another taxonomy.

Topic Closed

This topic has been closed to new replies.

About this Topic