Adding ACF Fields as Admin Columns to your CPT

For Non-Technical People

There are a few plugins that can accomplish adding your ACF fields as admin columns to the backend. Admin Columns is good one that does the trick.  The paid version allows your custom post type to connect with ACF Pro.

 

For Developers


function my_page_columns($columns) {
  $columns = array(
    'cb' => '< input type="checkbox" />',
    'title' => 'Title',
    'the-custom-field' => 'Custom Field'
  );
  return $columns;
}

function my_custom_columns($column) {
  global $post;
  if($column == 'seminar-date') {
    echo get_field('the-custom-field', $post->ID);
  }
  else {
    echo '';
  }
}

add_action("manage_CPTNAME_posts_custom_column", "my_custom_columns");
add_filter("manage_edit-CPTNAME_columns", "my_page_columns");
  
 

Share this...
Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn