Help Adding Custom Post Taxonomy Categories to Custom Post Type Overview Page
-
I’m having trouble adding custom post taxonomies (custom post type categories) to the overview page for a custom post type.
This is the code I have in functions.php to control what is viewable on the overview page for this custom post type.
The custom post type name is ‘blog’ and the custom category name is ‘blog_category’. You can see that I have hidden the default ‘categories’ as I don’t want to pull post type categories, but have tried to add Blog Categories instead. I just get an empty column with the header!
I’m obviously missing adding the content part. Any help would be much appreciated!
/* Add Columns (tags & cats) to Blog admin overview */ add_filter('manage_edit-blog_columns', 'add_new_blog_columns'); function add_new_blog_columns($blog_columns) { $new_columns['cb'] = '<input type="checkbox" />'; //$new_columns['id'] = __('ID'); $new_columns['title'] = _x('Title', 'column name'); //$new_columns['images'] = __('Images'); $new_columns['author'] = __('Author'); //$new_columns['categories'] = __('Categories'); $new_columns['blog_category'] = __('Blog Categories'); $new_columns['tags'] = __('Tags'); $new_columns['comments'] = '<span class="vers"><img alt="' . esc_attr__( 'Comments' ) . '" src="' . esc_url( admin_url( 'images/comment-grey-bubble.png' ) ) . '" /></span>'; $new_columns['date'] = _x('Date', 'column name'); $new_columns['wpseo-score'] = __( 'SEO', 'wordpress-seo' ); $new_columns['wpseo-title'] = __( 'SEO Title', 'wordpress-seo' ); $new_columns['wpseo-metadesc'] = __( 'Meta Desc.', 'wordpress-seo' ); $new_columns['wpseo-focuskw'] = __( 'Focus KW','wordpress-seo' ); return $new_columns; }
I would also like to be able to sort by ‘View all Blog Categories’ above the list of posts – and be able to sort by the custom taxonomy category terms rather than just by the default post category terms.
- The topic ‘Help Adding Custom Post Taxonomy Categories to Custom Post Type Overview Page’ is closed to new replies.