- This topic has 2 replies, 2 voices, and was last updated 3 years, 11 months ago by .
-
Topic
-
I tried to add a custom column using get_post_meta but its not displaying?
class Prefix_Custom_Admin_Columns extends MB_Admin_Columns_Post { public function columns($columns) { $columns = parent::columns($columns); /** * Add more column in a specific position * * @param string $position New column position. Empty to not specify the position. Could be 'before', 'after' or 'replace' * @param string $target The target column. Used with combination with $position */ $this->add($columns, 'col_category', 'Category', 'after', 'title'); $this->add($columns, 'col_featured_image', 'Image', 'after', 'col_category'); return $columns; } public function show($column, $post_id){ switch($column){ case 'col_featured_image': // This Works fine the_post_thumbnail(array(70,70)); // This doesn't work // echo get_the_post_thumbnail(array(70,70)) break; case 'col_category': // Not Displaying echo get_post_meta($post_id, 'brn_category', true); break; } } }
even i tried to echo get_the_post_thumbnail() is not displaying too
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.