function cptbc_columns_content($column_name, $post_ID) { if ($column_name == 'featured_image') { $post_featured_image = cptbc_get_featured_image($post_ID); if ($post_featured_image) { echo '<a href="' . get_edit_post_link($post_ID) . '"><img src="' . $post_featured_image . '" /></a>'; } } }
function cptbc_columns_content($column_name, $post_ID) { if ($column_name == 'featured_image') { $post_featured_image = cptbc_get_featured_image($post_ID); if ($post_featured_image) { echo '<a href="' . get_edit_post_link($post_ID) . '"><img src="' . $post_featured_image . '" alt="" style="max-width:100%;" /></a>'; } } if ($column_name == 'category') { $post_categories = get_the_terms($post_ID, 'carousel_category'); if ($post_categories) { $output = ''; foreach ($post_categories as $cat) { $output .= $cat->name . ', '; } echo trim($output, ', '); } else { echo 'No categories'; } } }