You can add custom columns in wp-admin to show parent category. It’s here my code, you can try it (I tested with post_type
is post
(default)).
// Add the custom columns to the post post type:
add_filter( 'manage_post_posts_columns', 'set_custom_edit_post_columns' );
function set_custom_edit_post_columns($columns) {
$columns['parent_cat'] = __( 'Parent Category', 'storefront' );
return $columns;
}
// Add the data to the custom columns for the post post type:
add_action( 'manage_post_posts_custom_column' , 'custom_post_column', 10, 2 );
function custom_post_column( $column, $post_id ) {
if($column == 'parent_cat'){
$terms = get_terms('category');
foreach ($terms as $term) {
if($term->parent == 0){
echo $term->name;
}
}
}
}
Here is screenshot to view: http://nimb.ws/RpoV8W
Related Posts:
- Get Custom Taxonomy ID within loop
- Get custom post type by category in a page template
- Categories under custom post types doesn’t show properly
- Ajax filter with custom taxonomies
- Filter posts with ajax form and checkboxes
- How to get only one category of custom post type?
- Get all taxonomies for all post types
- Append taxonomy terms as class names in markup?
- Show ACF field from custom taxonomy and display on the single template
- List terms from Custom Taxonomy
- WP_Query search posts by custom post type and custom taxonomy
- Order WordPress Custom Taxonomy Pages & Pagination Not Working
- How to output wordpress custom tags separated by comma?
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- Weird problem happening with custom taxonmy when creating/updating posts
- Taxonomy Archive: Display only one post per term from separate custom taxonomy
- How to display selected taxonomies by their parent
- Custom Field Order by Last Name and First Name
- get_posts of Custom Post Type AND Custom Taxonomy
- Received nothing after executing AJAX post function
- Get custom post type list for every category shortcode
- 404 error when navigating to a taxonomy page with Cyrillic, what’s wrong?
- Why are taxonomy terms not saving when using custom meta boxes with radio button taxonomy selectors?
- Categorize custom post type
- Custom post type editor with dynamic selects, one drop down populating a second second drop down not working
- Different Category system needed for the Custom Post Type
- Get term name without a foreach loop
- Trying to get custom post of a custom taxonomy
- Control content before and after custom post type loop
- Get custom post type categories to show up in menus
- Show current custom taxonomy
- Different options per post type in WP_Query
- Creating a non-hierarchical Taxonomy that behaves like categories
- get_terms() returns Trying to get property of non-object error for custom taxonomy
- Query custom post types & Taxonomies and list them in a table on a page
- Custom post type and custom taxonomy 404 on page 2
- Nested Custom Taxonomies | Incorrect posts when querying
- Commas not displaying in implode
- add custom tags for custom post type in wordpress
- Displaying One Custom Post Type’s Content On Single Post of Another Custom Post Type
- Foreach loop returning more than one item when querying taxonomy
- Function to erase every post from a taxonomy
- Compare Two Custom Post Types Using The Same Custom Taxonomy
- Using page title as a link to term archive
- Setup page template array in a custom post type
- How do I ensure that post_type and Taxonomy use the same slug?
- Custom post type page with parameter
- How to get post count of specific taxonomy that have store name & category
- Create a Dropdown Selector and Redirect for a Custom Taxonomy in WordPress?
- Change Dropdown jQuery to show/hide but with default place holder that shows all
- Custom front-end form for adding post – Category problem
- set object terms after some some time of published post – functions.php
- update custom taxonomy custom fields
- Filter taxonomy by CPT
- Get all post under custom post type grouped by custom filed value in custom taxonomy
- Check that a slug is present in the get_terms request
- Assigning categories to custom post types via a front-end form; only works for native post type
- pagination problem listing custom post types of taxonomy in wordpress
- Taxonomies are not showing in the category dropdown
- Combine multiple separate lists into one
- Filter Custom Post Type Posts by Taxonomy
- Change Search display for Custom Post Type
- Show parent category and subcategory once in while loop
- Custom search for a custom post type in WordPress
- Custom Taxonomy – fields
- tax_query not working?
- Add active class to foundation 6 tabs while looping categories
- The most recent post of custom taxonomy
- Show tags of custom post types in WordPress
- WordPress query posts by custom post type not workng
- Show custom taxonomy not in submenu
- Getting a 404 on single custom post type page when using rewrite on a custom taxonomy
- Pods pagination erases my sub menu
- Create 2-layered dropdown menus for custom taxonomy and custom post type
- How to Fix WordPress 500 Internal server error due to custom post type
- Values inside a custom field to determine which category posts to display
- Exclude Custom Post Type from shared Custom Taxonomy
- Show Custom Post Type taxonomy term that matches custom field
- WordPress Custom Post Type and sort by Tags
- Order by custom field attribute
- Looping taxonomy in taxonomy?
- Building a List of Posts grouped by custom taxonomy as the section header only to be displayed if at least one post is in that tax
- posting twice from an array?
- Custom Loop for custom post type. Compare by meta_value?
- Inserting two categories
- Display ONLY ONE $term (Out of 4 terms) from a Custom Taxonomy and CPT
- How do loop categories post from according in WordPress? is it impossible to solve this problem?
- How to filter post data with AJAX on page?
- Assign category to front end post
- Custom taxonomy in custom post RSS feed
- How to display product subcategories into my custom post type single page
- WordPress Doesn’t Generate Taxonomy Archive
- Get posts from Custom Taxonomy
- Reusable metabox backend and frontend
- pagination for custom post type archive page
- Is it possible to get the specific content on the search page?
- Custom post categories are not displaying on the page
- Get posts under custom taxonomy and custom post type
- How to Associate Posts with Pages
- Dynamically count the number of custom post types associated to a custom taxonomy