WordPress let’s you define where a post type appears in the args where you register it. It’s the show_in_menu
argument. You can set it to true, false or a the slug (a string) of the page under which you’d like it to appear.
So, let’s say you already have a post type “main”. To display another post type under that you’d set the show_in_menu
argument, like so:
<?php
// the register the post type
add_action( 'init', 'wpse4178_register' );
function wpse4178_register()
{
// probably some more args up here.
$args['show_in_menu'] = 'edit.php?post_type=main';
register_post_type( 'country', $args );
}
Related Posts:
- Show Custom Taxonomy Inside Custom Menu
- Prevent custom taxonomy from being added to admin menu?
- How to display Custom Taxonomy under Custom Admin Menu?
- Reusable metabox backend and frontend
- Show custom taxonomy not in submenu
- Custom Taxonomy Showing in WP Menu
- Show custom taxonomies in admin panel under custom post type
- Separating a custom taxonomy from blog post-type
- Set relationship between custom_post_types
- Remove admin menu for custom taxonomy attached to custom post type
- How do I list custom taxonomy terms without the links?
- Page not found taxonomy custom post type
- How to list custom taxonomy categories?
- clients list using wordpress
- Can I have Post Types under other Post Types in Admin menu?
- Custom taxonomy query for a custom post type
- Add/overwrite a parameter on an existing post type/taxonomy
- Get the ‘slug’ of a custom taxonomy
- Custom Metabox with Taxonomy Dropdown – Saving Issue
- Custom Post Type / Taxonomy Slug / Post Title with post type archive
- Term Checklist Walker – Disable Parent Categories
- Show certain terms from custom taxonomy but exclude ‘parent’ terms?
- Limiting number of custom posts shown on taxonomy page
- Custom Taxonomy conditionals
- Page to display an archive of taxonomies
- Help with issues on “Adding a Taxonomy Filter to Admin List for a Custom Post Type?”
- How to create archive page for taxonomy terms within custom post type
- How to make custom posts to behave like taxonomy?
- How do I provide a “show all posts” link in a paginated term archive?
- List terms from Custom Taxonomy
- Set object terms not working on plugin activation
- Display only post types that are direct children of the current taxonomy
- custom taxonomy relationship
- Parent & Child Taxonomy slugs in custom post permalink
- Should I use custom taxonomy or custom post type
- Custom Taxonomy Invalid in REST API
- How to use the post_title of custom post type as taxonomy
- Custom Post Type Archive Page Filtering
- Custom Post Type doesn’t show Draft and Trash Options
- Custom Post Type With Categories
- Missing Posts in Custom Taxonomy List
- Custom Taxonomy back-end customizations
- How do I change the custom taxonomy slug to be the same as the custom post type slug?
- Permalinks /country/city/cpt/postname/
- Seamless permalinks between Custom Taxonomy and Custom Posts
- browse by category and tags?
- Taxonomy structure help
- Create more category hierarchical depth for custom post type/taxonomy plugin (widget)
- How do I share categories across multiple post types?
- Show custom post type inside a custom post type
- What’s the name of the custom post type yearly archive template?
- Combine multiple getEntityRecords calls
- Custom URLs in post types make it impossible to view archive
- How to add and clear custom post types and taxonomies in a plugin? Considerations for existing data
- How to check if post/page or taxonomy post is published by admin
- Custom taxonomy or custom page templates?
- Permalink problems with custom post type and custom taxonomy
- Get terms of a post but only if they’re also the child of a specific term
- Custom Post Type Categories URL not displaying posts
- Custom order of Taxonomy Terms
- Custom Post Type Advanced Slug
- Custom post type subtaxonomy template
- tax_query (if the terms are empty)
- Getting only one post per category
- Should putting custom code in functions.php or created the plugins [duplicate]
- List all posts in taxonomy term
- Get posts by category name
- Create a custom taxonomy template that loops through child categories in term order?
- Create a Dropdown Selector and Redirect for a Custom Taxonomy in WordPress?
- How to Implement Search Functionality?
- How to implement very unusual wordpress routing structure?
- Post template with breadcrumb needs to show page navigated from
- How can i display a taxonomy? i have created a plugin and then a custom type. and a taxonomy , also i have register it
- Changing permalink of default Post with custom post
- get_queried_object not work in taxonomy page
- wp_insert_post deleting previous post custom meta
- Change custom post taxonomy values from front-end
- Pages of my taxonomy terms are showing all posts
- How to create a permalink structure with custom taxonomies and custom post types
- Is there a way to re-order the Custom Taxonomy drop-down on a Custom Post listing page?
- How to get all posts related to a taxonomy?
- Custom post types not displaying per category
- Custom Post Type tag taxonomy “Page Not Found”
- Remove custom post type slug but keep related category taxonomy permalink
- page not found for example.com/custom-post-name
- Create 2-layered dropdown menus for custom taxonomy and custom post type
- Hierarchical taxonomy in permalink structure
- predefined custom field on registration page
- Displaying taxonomy icon outside archive page
- Limit number of posts under a post type?
- Why won’t this rewrite rule work?
- Archive.php is not displaying tags
- How to not have the items of the subtaxonomy within the parent taxonomy
- How to save an integer as taxonomy term?
- Sort custom post type items by taxonomy description
- Tags and Taxonomy links not working for Custom Post Types
- Get custom post type parent category
- How can i change url structure of cpt like this?
- Create a hierarchical list of posts that’s grouped and nested by category
- Show a wordpress custom post condtionally using a category term