Title: setting columns in admin post_type
Last modified: November 30, 2023

---

# setting columns in admin post_type

 *  Resolved [madeleod](https://wordpress.org/support/users/madeleod/)
 * (@madeleod)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/setting-columns-in-admin-post_type/)
 * Hello,
 * I am trying to add columns in the admin pod post_type area. I’ve created the “
   book” pod as a separate table in my database but I am unable to display any value
   for these 2 fields. Any help? Thx.
 * Here is the code:
 *     ```wp-block-code
          function setting_column_book( $column ) {    
               $column['ref'] = 'Ref';
               $beginning = array_slice( $column, 0 ,1 );
               $beginning[ 'id' ] = __( 'ID');
               $ending = array_slice( $column, 1 );
               $column = array_merge( $beginning, $ending );
           return $column;
       } 
       add_filter( 'manage_book_posts_columns', 'setting_column_book' ); 
   
   
       function custom_value_column( $column, $post_id ) {
           switch ( $column ) {
   
               case 'ref' :
                   echo get_post_meta( $post_id , 'ref' , true );        
                   break;
   
               case 'id' :
                   echo get_post_meta( $post_id , 'id' , true ); 
                   break;
           }
       }
       add_action( 'manage_book_posts_column' , '_custom_value_column', 10, 2 );
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Jory Hogeveen](https://wordpress.org/support/users/keraweb/)
 * (@keraweb)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/setting-columns-in-admin-post_type/#post-17247678)
 * Hi [@madeleod](https://wordpress.org/support/users/madeleod/)
 * Please check the plugin Admin Columns, it does exactly what you are trying to
   do!
 * Cheers, Jory
 *  Thread Starter [madeleod](https://wordpress.org/support/users/madeleod/)
 * (@madeleod)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/setting-columns-in-admin-post_type/#post-17250180)
 * Thank you for the tip! The idea was not to use an other plugin to do so…

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘setting columns in admin post_type’ is closed to new replies.

 * ![](https://ps.w.org/pods/assets/icon.svg?rev=3286397)
 * [Pods - Custom Content Types and Fields](https://wordpress.org/plugins/pods/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pods/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pods/)
 * [Active Topics](https://wordpress.org/support/plugin/pods/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pods/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pods/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [madeleod](https://wordpress.org/support/users/madeleod/)
 * Last activity: [2 years, 6 months ago](https://wordpress.org/support/topic/setting-columns-in-admin-post_type/#post-17250180)
 * Status: resolved