Support

Account

Home Forums Backend Issues (wp-admin) adding date to admin columns Reply To: adding date to admin columns

  • Hi @rudtek

    That’s because you were using the get_post_meta() function instead of the get_field() function. This page should give you more idea about it: https://www.advancedcustomfields.com/resources/displaying-custom-field-values-in-your-theme/. So, you should be able to do it like this:

    function forum_custom_column ( $column, $post_id ) {
       switch ( $column ) {
         case 'event_date':
           echo get_field( 'event_date', $post_id );
           break;
         case 'event_location':
           echo get_field( 'event_location', $post_id );
           break;
       }
     }
    add_action ( 'manage_cr3ativconference_posts_custom_column', 'forum_custom_column', 10, 2 );

    I hope this helps 🙂