I added a custom column to a custom post type:
add_filter('manage_posts_columns', 'custom_columns', 10);
add_action('manage_posts_custom_column', 'custom_columns_thumb', 10, 2);
function custom_columns($columns) {
$columns = array(
'cb' => '<input type="checkbox" />',
'title' => 'Title',
'categories' => 'Categories', // not showing
'thumb' => __('Thumb'),
'date' => __( 'Date' )
);
return $columns;
}
function custom_columns_thumb($column_name, $id){
if($column_name === 'thumb') {
echo the_post_thumbnail( 'thumb' );
}
}
The custom column "thumb" shows properly but the category is no longer displayed. Please see image.
What is causing this? The categories show if I remove the custom columns.
category
, notcategories
.categories
can be a valid custom taxonomypost
, notposts
.posts
can be a valid custom post type