1

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, B&B, 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.

0

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/

  • I'll check this out today, but I'm not sure this is as elegant a solution as I'd like. There are a lot of reports of it breaking pagination, the structure has to be changed to %postname% (not sure why), I read you have to manually update permalinks each time you add a new taxonomy, and I'm not sure it'll play well with other structures I will have throughout the site. Either way, I'll give it a try, and see how it turns out, thanks for the link. – Porter Apr 9 '15 at 17:32
  • I tried to implement this tonight, and it wouldn't work for me. I'm 99.99% sure I followed the simple instructions, but I get a 404 on site.com/dining/actual-post The archives for the taxonomy and terms work at site.com/dining and site.com/dining/restaurants, but the actual posts of the custom post type are giving me 404. I flushed my permalinks, added single-dining.php, etc, nothing works. – Porter Apr 10 '15 at 5:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.