Hey @kaavyaiyer so I created my Platform post type after setting a custom rewrite slug for the platforms taxonomy to “platform-taxonomy”
Unfortunately, after creating the platform post type, my platform taxonomy links still all broke and the rewrite slug just stopped working.
Even weirder and more problematic, the Platform taxonomy terms I’ve created won’t show up on Platform post-type pages.
Here’s a screenshot to show you what I mean.
The taxonomy terms show up on their page (see here), so I’m not sure why this is happening.
Any advice?
If it makes a difference, I’m using the CPT UI plugin to create the custom taxonomies and post types.
Here’s the platform taxonomy code:
function cptui_register_my_taxes_platform() {
/**
* Taxonomy: Platforms.
*/
$labels = [
"name" => __( "Platforms", "smart-passive-income-pro" ),
"singular_name" => __( "Platform", "smart-passive-income-pro" ),
"menu_name" => __( "Platforms", "smart-passive-income-pro" ),
"all_items" => __( "All Platforms", "smart-passive-income-pro" ),
"edit_item" => __( "Edit Platform", "smart-passive-income-pro" ),
"view_item" => __( "View Platform", "smart-passive-income-pro" ),
"update_item" => __( "Update Platform name", "smart-passive-income-pro" ),
"add_new_item" => __( "Add new Platform", "smart-passive-income-pro" ),
"new_item_name" => __( "New Platform name", "smart-passive-income-pro" ),
"parent_item" => __( "Parent Platform", "smart-passive-income-pro" ),
"parent_item_colon" => __( "Parent Platform:", "smart-passive-income-pro" ),
"search_items" => __( "Search Platforms", "smart-passive-income-pro" ),
"popular_items" => __( "Popular Platforms", "smart-passive-income-pro" ),
"separate_items_with_commas" => __( "Separate Platforms with commas", "smart-passive-income-pro" ),
"add_or_remove_items" => __( "Add or remove Platforms", "smart-passive-income-pro" ),
"choose_from_most_used" => __( "Choose from the most used Platforms", "smart-passive-income-pro" ),
"not_found" => __( "No Platforms found", "smart-passive-income-pro" ),
"no_terms" => __( "No Platforms", "smart-passive-income-pro" ),
"items_list_navigation" => __( "Platforms list navigation", "smart-passive-income-pro" ),
"items_list" => __( "Platforms list", "smart-passive-income-pro" ),
"back_to_items" => __( "Back to Platforms", "smart-passive-income-pro" ),
];
$args = [
"label" => __( "Platforms", "smart-passive-income-pro" ),
"labels" => $labels,
"public" => true,
"publicly_queryable" => true,
"hierarchical" => true,
"show_ui" => true,
"show_in_menu" => true,
"show_in_nav_menus" => true,
"query_var" => true,
"rewrite" => [ 'slug' => 'platform-taxonomy', 'with_front' => true, ],
"show_admin_column" => false,
"show_in_rest" => true,
"show_tagcloud" => false,
"rest_base" => "platform",
"rest_controller_class" => "WP_REST_Terms_Controller",
"show_in_quick_edit" => false,
"show_in_graphql" => false,
];
register_taxonomy( "platform", [ "post", "platform" ], $args );
}
add_action( 'init', 'cptui_register_my_taxes_platform' );
And here’s the platforms post type code:
function cptui_register_my_cpts_platform() {
/**
* Post Type: Platforms.
*/
$labels = [
"name" => __( "Platforms", "smart-passive-income-pro" ),
"singular_name" => __( "Platform", "smart-passive-income-pro" ),
"menu_name" => __( "My Platforms", "smart-passive-income-pro" ),
"all_items" => __( "All Platforms", "smart-passive-income-pro" ),
"add_new" => __( "Add new", "smart-passive-income-pro" ),
"add_new_item" => __( "Add new Platform", "smart-passive-income-pro" ),
"edit_item" => __( "Edit Platform", "smart-passive-income-pro" ),
"new_item" => __( "New Platform", "smart-passive-income-pro" ),
"view_item" => __( "View Platform", "smart-passive-income-pro" ),
"view_items" => __( "View Platforms", "smart-passive-income-pro" ),
"search_items" => __( "Search Platforms", "smart-passive-income-pro" ),
"not_found" => __( "No Platforms found", "smart-passive-income-pro" ),
"not_found_in_trash" => __( "No Platforms found in trash", "smart-passive-income-pro" ),
"parent" => __( "Parent Platform:", "smart-passive-income-pro" ),
"featured_image" => __( "Featured image for this Platform", "smart-passive-income-pro" ),
"set_featured_image" => __( "Set featured image for this Platform", "smart-passive-income-pro" ),
"remove_featured_image" => __( "Remove featured image for this Platform", "smart-passive-income-pro" ),
"use_featured_image" => __( "Use as featured image for this Platform", "smart-passive-income-pro" ),
"archives" => __( "Platform archives", "smart-passive-income-pro" ),
"insert_into_item" => __( "Insert into Platform", "smart-passive-income-pro" ),
"uploaded_to_this_item" => __( "Upload to this Platform", "smart-passive-income-pro" ),
"filter_items_list" => __( "Filter Platforms list", "smart-passive-income-pro" ),
"items_list_navigation" => __( "Platforms list navigation", "smart-passive-income-pro" ),
"items_list" => __( "Platforms list", "smart-passive-income-pro" ),
"attributes" => __( "Platforms attributes", "smart-passive-income-pro" ),
"name_admin_bar" => __( "Platform", "smart-passive-income-pro" ),
"item_published" => __( "Platform published", "smart-passive-income-pro" ),
"item_published_privately" => __( "Platform published privately.", "smart-passive-income-pro" ),
"item_reverted_to_draft" => __( "Platform reverted to draft.", "smart-passive-income-pro" ),
"item_scheduled" => __( "Platform scheduled", "smart-passive-income-pro" ),
"item_updated" => __( "Platform updated.", "smart-passive-income-pro" ),
"parent_item_colon" => __( "Parent Platform:", "smart-passive-income-pro" ),
];
$args = [
"label" => __( "Platforms", "smart-passive-income-pro" ),
"labels" => $labels,
"description" => "",
"public" => true,
"publicly_queryable" => true,
"show_ui" => true,
"show_in_rest" => true,
"rest_base" => "",
"rest_controller_class" => "WP_REST_Posts_Controller",
"has_archive" => false,
"show_in_menu" => true,
"show_in_nav_menus" => true,
"delete_with_user" => false,
"exclude_from_search" => false,
"capability_type" => "post",
"map_meta_cap" => true,
"hierarchical" => false,
"rewrite" => [ "slug" => "platform", "with_front" => true ],
"query_var" => true,
"menu_icon" => "dashicons-money-alt",
"supports" => [ "title", "editor", "thumbnail", "custom-fields", "post-formats" ],
"taxonomies" => [ "category", "country", "payout_option", "platform" ],
"show_in_graphql" => false,
];
register_post_type( "platform", $args );
}
add_action( 'init', 'cptui_register_my_cpts_platform' );
Any help would be greatly appreciated.