【发布时间】:2022-07-12 22:05:21
【问题描述】:
如下面的屏幕截图所示,我在管理仪表板中的列没有换行,而且太小,无法容纳我为帖子创建的所有分类。你们有谁知道简单的修复、函数或 CSS 吗?
我不确定它是否相关,但这是我添加到 functions.php 的自定义分类代码:
add_action( 'init', 'create_subjects_hierarchical_taxonomy', 0 );
//create a custom taxonomy name it subjects for your posts
function create_subjects_hierarchical_taxonomy() {
// Add new taxonomy, make it hierarchical like categories
// First do the translations part for GUI
// Add volume taxonomy
$labels = array(
'name' => _x( 'Volumes', 'taxonomy general name' ),
'singular_name' => _x( 'Volume', 'taxonomy singular name' ),
'search_items' => __( 'Search Volumes' ),
'all_items' => __( 'All Volumes' ),
'parent_item' => __( 'Parent Volume' ),
'parent_item_colon' => __( 'Parent Volume:' ),
'edit_item' => __( 'Edit Volume' ),
'update_item' => __( 'Update Volume' ),
'add_new_item' => __( 'Add New Volume' ),
'new_item_name' => __( 'New Volume Name' ),
'menu_name' => __( 'Volumes' ),
);
// Register the taxonomy
register_taxonomy('volumes',array('post'), array(
'hierarchical' => true,
'labels' => $labels,
'show_ui' => true,
'show_in_rest' => true,
'show_admin_column' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'volume' ),
));
【问题讨论】: