• I have a structure like so:

    Dining – (Custom Post Type)

    dining_types (Custom Taxonomy belonging to Dining Custom Post Type)

    -restaurants (term)
    -cafes (term)
    -delis (term)
    -street-vendors (term)

    I’m trying to programmatically assign custom templates for the following:

    -Custom Post Type (Dining) site.com/dining
    -Terms of dining_types custom taxonomy (Restaurants) site.com/dining/restaurants

    I can get is_post_type_archive to work (site.com/dining), but for whatever reason, I can’t seem to get the taxonomy to work (site.com/dining/restaurants). The page is an archive, but my conditional check isn’t working. I used:

    if (is_tax('dining', 'restaurants')) {

    I’ve tried just doing dining, to see if ALL terms would display in such a way, but no luck. What conditional check do I need to get site.com/dining/restaurants to use a custom archive? Again, dining is the custom post type, restaurants is a “term” of the “dining_types (slug “dining”) custom taxonomy.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Gemfruit

    (@gemfruit)

    I changed the rewrite slug of my custom taxonomy to “dining_types” instead of dining, and my conditional works now. This means that my custom post of “dining” is somehow conflicting with the rewrite slug of “dining” for my custom taxonomy.

    Between with_front, hierarchical, and the rest of the information I’ve taken in, I’m completely swamped / stumped. I feel like this should be relatively easy to achieve, but I just can’t get it. If anyone could lend me a hand in putting this multi-week nightmare to rest, I’d be extremely grateful.

    Thread Starter Gemfruit

    (@gemfruit)

    I’ve now got the conditionals working, but because of duplicate slugs, I can’t get the structure working. I have:

    ite.com/dining (works)
    site.com/dining/specific-location (404)
    site.com/dining/custom-term-a (works)
    site.com/dining/custom-term-b (works)

    I refuse to believe this isn’t possible, it’s so basic, and so logical. Let me add that I also don’t need WordPress to do anything with these by default, I’m adding my own templates, so “messing up default behavior” isn’t an issue, I just need those urls to work. There must be a rewrite rule, or something out there, that will allow this.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Custom Taxonomy URL Structure’ is closed to new replies.