First, you need to declare/register the new columns:
add_filter( 'manage_tour_posts_columns', 'cyb_add_new_columns' );
function cyb_add_new_columns() {
$columns['price'] = __('Price column title', 'cyb-textdomain' );
$columns['test'] = __('Test column title', 'cyb-textdomain' );
return $columns;
}
Then, you can print the content of the column for each post:
add_action('manage_tour_posts_custom_column', 'tour_price_col', 10 ,2);
function tour_price_col( $column, $post_id){
switch ( $column ) {
case 'price':
echo get_post_meta( $post_id, 'tour-price', true );
break;
case 'test':
echo "salam";
break;
}
}
Related Posts:
- Adding ‘menu order’ column to custom post type admin screen
- Style custom columns in admin panels (especially to adjust column cell widths)
- How do I set the default admin sort order for a custom post type to a custom column?
- Replacing the title in admin list table
- Make custom column sortable
- Custom sortable columns ordered by meta-value?
- Add “Last Edited by” column to custom post type list table
- How to add custom columns to Custom Post Type admin screen
- Column sorting with emtpy meta values
- manage posts custom column is not populating data from meta boxes
- Custom admin columns for ALL custom post types
- order of date column in custom post type
- Add custom column to custom post type overview in backend
- custom sortable column
- Custom Post Type, Two categories, Two columns with Pagination
- Replacing the title in admin list table
- Remove Post Page “View Post” Link
- How can I add columns to custom post tables
- Custom Post Types: Custom columns with Title submenu?
- How to show custom (checkbox) field value in admin post list?
- Adding menu_order to CPT admin page
- Custom post admin filtering by post meta (the date)
- Admin Column Text Positioning
- How do I sort a custom post type admin column using two meta keys?
- Add Post Url to Manage Edit Screen
- Problem adding column to WC Subscription [closed]
- how to check if custom post type column already exists?
- Adding HTML tags or css classes to admin columns
- Extending AZIndex plugin to use custom post types and custom taxonomies
- WP CPT Custom Sortable Column in Admin Dashboard Sort Order Random
- How to show first name and last name in custom post type columns
- Order a custom post type admin screen by a second custom post type title
- WordPress make Grandparent and great grandparent filterable in custom columns
- 4 column-loop ordered alphabetically with entries grouped (and labeled) by their first letter
- How can I use this code on a custom database table?
- Problem with $post_id object’s property
- Pods CMS: How to add custom column to Adnvanced Content Type
- CPT Columns doesn’t show categories
- Getting post attchment URL to populate a CPT Admin Page Column
- Custom Columns for Custom Post Type Manager
- Make a custom column sortable by a value from a different custom post type
- Sorting custom post types in edit.php : Post disappear
- Custom sortable column with WPAlchemy
- Remove filter and view options from custom post type edit screen
- Sortable column with custom data by date
- Add Content Column to Custom Post Type backend
- Hide Published text from custom post types column
- custom filtering admin columns
- Custom sorting in post columns by ACF Pro Select Field
- Columns depending on posts count
- Making my custom column sortable
- Default custom column to off
- Change column of row action (Quick Edit) links in WP_List_Table
- Make custom post type column sortable
- Split custom post list into two columns
- Meta query with boolean true/false value
- Two Custom Post Types, Share Two Taxonomies
- Remove CPT slug from URL
- WordPress metabox file upload in custom post [duplicate]
- How to show custom post type count in the users admin page
- How-to leverage WordPress for creating Extended Social Profiles
- Add custom post type to Backbone collections
- pagination redirecting from page number url before page requested
- Get all of user’s custom post types in WP Admin for plugin
- Query Multiple Taxominies Across Multiple Post type’s
- Does anyone have a plugin that could automatically tag custom post types in wordpress?
- Stop / prevent WordPress from updating permalinks of custom post type
- How can I dynamically add a post to a custom post type which uses a custom field?
- How can we take into account post types when constructing permalinks?
- Posts Categories Are Showing In The Custom Post Type Category
- Get post count for search result based on post type
- Modification of how the data is controlled/showed and stored
- Show fields based on taxonomy selection in editor
- Wrapping x posts in html without leaving empty html
- Page not found for custom post type UI plugin and taxonomy
- How to Get the title of a custom field?
- Template for custom post type when taxonomy is in the URL
- Targeting child pages of custom post types using function?
- Query custom post types & Taxonomies and list them in a table on a page
- How should i sort “Last Update” Custom Column?
- Modify a plugin function output from another plugin
- Yelp-style geographic directory plugin?
- Modifying search results based on post_type
- WordPress general content best pratices
- Stop displaying Permalink
- Custom post type template – add banner under heading
- How to get current post type?
- How to convert Post Object Custom Field into Tags
- how to allow subscriber to add/edit/delete custom post type
- Page as parent for CPT and other pages
- Different taxonomy.php for different custom post types
- How to keep a CPT stick to specific position?
- Shortcode display CPT Query only showing 1 post?
- Custom post types & Thumbnails
- Strange behaviour using 3.8.1
- Repeatable Custom Field for Media Upload
- How to store datetime from custom meta box so that it can be sorted by
- Is there any way of not using my_init_method in the following code (that creates a custom post type)?
- Display ONLY ONE $term (Out of 4 terms) from a Custom Taxonomy and CPT
- Adding a custom field after post title (ex.Example Title [30 Second Read])