• I’ve created seven Custom Taxonomies and assigned them to two CPTs. I’m using three Custom Taxonomies with Radio Buttons and they also show up in my Blog Posts sidebar. They’re not assigned to Posts and shouldn’t appear there.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author HelgaTheViking

    (@helgatheviking)

    Hi Doug. Do you mean the radio buttons for a CPT appears in your posts? And are you using the block editor (aka Gutenberg?) or the classic editor?

    Thread Starter Doug Rider

    (@riderworks)

    I’m using the Block editor. Yes, the radio buttons for my CPT appears in the Posts Admin sidebar.

    Plugin Author HelgaTheViking

    (@helgatheviking)

    I am not able to reproduce this. I have a “Genre” taxonomy set up for a “Book” CPT.

    
    function kia_create_book_taxonomies() {
    	// Add new taxonomy, make it hierarchical (like categories)
    	$labels = array(
    		'name'              => _x( 'Genres', 'taxonomy general name', 'textdomain' ),
    		'singular_name'     => _x( 'Genre', 'taxonomy singular name', 'textdomain' ),
    		'search_items'      => __( 'Search Genres', 'textdomain' ),
    		'all_items'         => __( 'All Genres', 'textdomain' ),
    		'parent_item'       => __( 'Parent Genre', 'textdomain' ),
    		'parent_item_colon' => __( 'Parent Genre:', 'textdomain' ),
    		'edit_item'         => __( 'Edit Genre', 'textdomain' ),
    		'update_item'       => __( 'Update Genre', 'textdomain' ),
    		'add_new_item'      => __( 'Add New Genre', 'textdomain' ),
    		'new_item_name'     => __( 'New Genre Name', 'textdomain' ),
    		'menu_name'         => __( 'Genre', 'textdomain' ),
    	);
    
    	$args = array(
    		'hierarchical'      => false,
    		'labels'            => $labels,
    		'show_ui'           => true,
    		'show_in_rest'			=> true,
    		'show_admin_column' => true,
    		'query_var'         => true,
    		'rewrite'           => array( 'slug' => 'genre' ),
    		'default_term' => array( 'name' => 'My default genre', 'slug' => 'default-genre' ),
    	);
    
    	register_taxonomy( 'genre', array( 'book' ), $args );
    }
    add_action( 'init', 'kia_create_book_taxonomies' );
    
    /**
     * Register a custom post type called "book".
     *
     * @see get_post_type_labels() for label keys.
     */
    function kia_codex_book_init() {
        $args = array(
            'public' => true,
            'label'  => __( 'Books', 'textdomain' ),
    		'supports'           => array( 'title', 'editor', 'author', 'thumbnail' ),
            'show_in_rest'       => true
    	);
     
        register_post_type( 'book', $args );
    }
     
    add_action( 'init', 'kia_codex_book_init' );
    

    And I’ve set post categories and genres to use RB4T. The genres do not appear in the post’s editor.

    Are you sure that your taxonomies are not registered to more than one CPT? It’s possible to register a taxonomy to more than one post type and RB4T would have no way to discern.

    I’d also recommend testing with the least amount of code required…. so just a default theme, RB4T, and the code that registers the CPT and taxonomies.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom Taxonomies displaying in Posts’ is closed to new replies.