i created a custom post type (call bookmaker_post_type) with more custom taxonomies asociated but i have problem to display the terms selected of each taxonomy. I tried to use the function the_terms <td><?php the_terms( $post->ID, 'countrie'); ?></td>
in post single but not show nothing. I also tried to insert the function in the loop but nothing. Where i wrong?
taxonomy code
// Add new taxonomy Countries, make it hierarchical (like categories)
$labels = array(
'name' => _x( 'Countries', 'taxonomy general name', 'textdomain' ),
'singular_name' => _x( 'Countrie', 'taxonomy singular name', 'textdomain' ),
'search_items' => __( 'Search Countries', 'textdomain' ),
'all_items' => __( 'All Countries', 'textdomain' ),
'parent_item' => __( 'Parent Countrie', 'textdomain' ),
'parent_item_colon' => __( 'Parent Countrie:', 'textdomain' ),
'edit_item' => __( 'Edit Countrie', 'textdomain' ),
'update_item' => __( 'Update Countrie', 'textdomain' ),
'add_new_item' => __( 'Add New Countrie', 'textdomain' ),
'new_item_name' => __( 'New Countrie Name', 'textdomain' ),
'menu_name' => __( 'Countrie', 'textdomain' ),
);
$args = array(
'hierarchical' => true,
'labels' => $labels,
'show_ui' => true,
'show_admin_column' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'countrie' ),
);
register_taxonomy( 'countrie', array( 'bookmaker' ), $args );
unset( $args );
unset( $labels );
}
question from:
https://stackoverflow.com/questions/65860072/problem-to-display-taxonomies-terms-in-wordpress 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…