I'll try to explain how I want this to work, rather than what I've done so far, as nothing seems to work.
I want 3 custom post types:
with the following slugs:
Each of the post types will need a custom archive page, ie. actual page that can be edited by the user.
Both accessories and consumables would need to be hierarhial, as I have sub-categories for both. I have considered using taxonomies for this, but that presents the same problem: I need an overview page that can be edited by the user (in the WYSIWYG editor), on the apropriate URL.
I have currently done the overview pages as such
example.com/products - is a regular page with name and slug: "products" example.com/products/consumables - is a product with name and slug: "consumables"
ie. every overview page is situated in the root just above the appropriate post type, which is just so counterintuitive. To edit the consumables page, you go in to "products", not "consumables".
My biggest problem is that if I just define the rewrite slugs as above, only one of the post types will actually work, seemingly a random one, but I guess it has something to do with rewrite priorities. For example, all Products pages will work, but none of the Consumables or Accessories pages will.
Here's an example of the CPT code for the Product CPT:
register_post_type('product', array( 'label' => 'Products', 'description' => 'Product', 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'capability_type' => 'page', 'map_meta_cap' => true, 'hierarchical' => true, 'rewrite' => array('slug' => 'products', 'with_front' => 0), 'query_var' => true, 'supports' => array('title', 'editor', 'custom-fields', 'revisions', 'thumbnail', 'page-attributes'), 'labels' => array( 'name' => 'Products', 'singular_name' => 'Product', 'menu_name' => 'Products', 'add_new' => 'Add Product', 'add_new_item' => 'Add New Product', 'edit' => 'Edit', 'edit_item' => 'Edit Product', 'new_item' => 'New Product', 'view' => 'View Product', 'view_item' => 'View Product', 'search_items' => 'Search Products', 'not_found' => 'No Products Found', 'not_found_in_trash' => 'No Products Found in Trash', 'parent' => 'Parent Product', ) ));
The two others, Consumables and Accessories, would be similar with the rewrite slug being 'products/consumables', or 'products/accessories'
My hope is that I can fix this by making some custom rewrite rules that will override whatever is messing this up, but I have never tried that before, and I'm not sure that would be the solution.