Please try the code given below to add custom columns to default post type to display custom field data and make changes to the code as per your requirement.
// Add the custom columns
add_filter( 'manage_posts_columns', 'set_custom_edit_posts_columns' );
function set_custom_edit_posts_columns($columns) {
$columns['first_field_name'] = 'Custom Field First';
$columns['second_field_name'] = 'Custom Field Second';
return $columns;
}
// Add the data to the custom columns
add_action( 'manage_posts_custom_column' , 'custom_posts_column', 10, 2 );
function custom_posts_column( $column, $post_id ) {
switch ( $column ) {
case 'first_field_name' :
echo 'First Field Data';
break;
case 'second_field_name' :
echo 'Second Field Data';
break;
}
}
Here “manage_posts_columns” is used to add the columns. You can change post type by adding custom post type name in “manage_your_post_type_name_posts_columns”. And “manage_posts_custom_column” will populate columns data. Where you can display your custom fields data. And here also you can set the post type by adding custom post type name in “manage_your_post_type_name_posts_custom_column”.
https://codex.wordpress.org/Plugin_API/Action_Reference/manage_$post_type_posts_custom_column
https://codex.wordpress.org/Plugin_API/Action_Reference/manage_posts_custom_column