我为您调整了代码。您可以在中直接使用代码functions.php 文件这里有更多的参考资料,可以帮助你了解更多。Link 1Link 2
// Adding Custom Column
add_filter(\'manage_stfic_posts_columns\', \'ST4_columns_head_only_stfic\', 10);
add_action(\'manage_stfic_posts_custom_column\', \'ST4_columns_content_only_stfic\', 10, 2);
// CREATE TWO FUNCTIONS TO HANDLE THE COLUMN
function ST4_columns_head_only_stfic($defaults) {
$defaults[\'bookcode\'] = \'Book Code\';
return $defaults;
}
function ST4_columns_content_only_stfic($column_name, $post_ID) {
if ($column_name == \'bookcode\') {
// Now you have to garb the meta value and show.
$book_code = get_post_meta($post_ID,\'bookcode\',true);
echo \'<span>\'.$book_code.\'</span>\';
}
}