您可以使用以下代码创建类别:
add_filter('list_pages', 'change_html', 10, 2);
function change_html($title, $page){
if(!is_admin()){
//To get category
$category = wp_get_object_terms( $page->ID, 'category' );
$category_name = $category[0]->name;
//To get tag
$tag = wp_get_post_tags($page->ID);
$tag_name = $tag[0]->name;
return $title.' ('.$category_name.')';
}
return $title;
//If you want Tag name, you can have it by following line
//return $title.' ('.$tag_name.')';
}