Duplicate Custom Post Type and Taxonomy Slug

I've seen a few questions that are very similar, but I haven't been able to get an exact answer, so I'm going to explain my situation here.

Quite simply, I need the following url structure:

site.com/dining (custom post type)

site.com/dining/restaurants (terms of custom taxonomy)

site.com/dining/specific-location (actual post of the custom post type)

This url structure will be repeated for multiple custom post types, such as lodging (terms of hotels, inns, BB, resorts, etc), Bars, etc. My current setup is:

Custom Post Type: "Dining" Custom Taxonomy: "Dining Types" Terms of "Dining Types" are the categories, such as cafes, restaurants, etc.

I did a rewrite on the url for the term to make it "dining" instead of "dining_types", but that had a conflict with the custom post type, as I've read will happen. So the question is, with this very basic structure, how on earth do I achieve the urls I listed above? I feel like it's an incredibly simple structure (especially compared to the other similar issues I've seen), yet I can't seem to get it.

Also worth noting, I'm programmatically assigning templates to anything and everything related to this setup, so I don't need any named files, it's all done with code.

Topic url-rewriting taxonomy posts customization Wordpress

Category Web


Here you can read an article about how to deal with. You'll have some mandatory things to do such rewrite your taxonomy with the same name of the custom post type.

http://someweblog.com/wordpress-custom-taxonomy-with-same-slug-as-custom-post-type/

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.