There is a quick and somewhat dirty potential solution to this. I say ‘potential’ because I can’t spot the problem by looking at the code. I only have my suspicions. Instead of passing a separator like that. Try trailingslashit
.
} else
$chain .= trailingslashit($name);
return $chain;
I am guessing at where the problem is based on your description, but that is the only place that $separator
is applied.
There is a case where this simple fix won’t work. If $name
is empty, you will get an extra slash in your string, so it would be better to check for that, just in case.
} elseif (!empty($name))
$chain .= trailingslashit($name);
return $chain;
Try that.
Related Posts:
- How to enable hierarchical permalinks for hierarchical taxonomies
- Need help understanding a rewrite with multi-level taxonomy
- get_posts assigned to a specific custom taxonomy term, and not the term’s children
- Get the the top-level parent of a custom taxonomy term
- Can’t get a custom template taxonomy page to display
- Determine Term depth
- Custom taxonomy listing page when no term set (all terms)
- Removing taxonomy base using WP rewrite
- Custom taxonomy on permalink
- Get taxonomy name of current post
- Determine if Term has Grandparent/Great-Grandparent
- Remove Custom Taxonomy Base
- Custom Taxonomy Relationship (ex: plant classification)
- Custom Taxonomy Only Showing Top Level Terms in Admin?
- How can I set up a category “overview” page?
- Dynamic page slug for Custom Taxonomies?
- How to check if last uri segment is a custom post type or taxonomy term?
- Custom permalinks – post type – hierarchical taxonomy’s
- Getting archive pages in WP’s AJAX internal link finder?
- custom taxonomies on permalink
- Pros and cons of using [taxonomy name] in place of [category name]?
- How to include parent terms in hierarchical taxonomy URLs?
- How to set hierarchical terms to a post using wp_set_object_terms
- Help building array hierarchically with taxonomies (to get posts)
- Permalinks for quote authors
- Hierarchical display of custom taxonomy
- Change in custom taxonomy permalink causes 404 error for another custom taxonomy
- Taxonomy based permalinks
- Custom Taxonomies: Multiple Hierarchical Permailnks For A Single Post + Prev/Next Links
- custom taxonomy archive permalink shows 404 error
- Custom taxonomy term in WooCommerce product permalink
- How to get parents of custom taxonomy, as what get_category_parents() do?
- Change URL structure of subcategory archive pages
- Add parent/child taxonomy to custom post type url
- Taxonomies: display hierarchical parent list
- How to create a permalink structure with custom taxonomies and custom post types like base-name/parent-tax/child-tax/custom-post-type-name
- Keep taxonomy base name in post permalinks
- Custom Post Type with two hierarchical Custom Taxonomies: strategy to generate best permalink structure
- Change permalink of post if it belongs to custom taxonomy
- Display hierarchical subterms of custom taxonomy based on depth
- Permalinks for custom taxonomy stopped to work
- Date archive permalinks for custom taxonomy
- Redirect all child taxonomy to its parent
- How do I display a list of posts under all hierarchical children of the current taxonomy?
- Register a pre defined tree of taxonomies
- How to create custom url structure based on custom post type rewrite slug, taxonomy and category slug?
- How do I modify taxonomy term slugs dynamically?
- Permalink help with default Posts and custom Taxonomy
- how to change permalinks format for pagination?
- How do I create a permalink structure with 2 taxonomies
- Base permalink for custom taxonomy
- Hierarchical Taxonomy Terms Select Menu Output with selected=”selected” Set
- Rewrite Rules returning wrong data
- Custom Taxonomies not retaining hierarchy while importing from one site to another
- Rewrite rules for varying nested terms of custom taxonomy
- List Posts For Terms Of A Custom Taxonomy For Any Post Type
- Using custom taxonomies to display hierarchical URLs?
- Custom post type Permalinks with hierarchical Taxonomies
- How to change url for taxonomy pages?
- Query custom taxonomy by term id?
- How to customize custom taxonomy url?
- tax_query: Don’t show posts with parent term when they have a corresponding child term applied
- Duplicate slug/permalink issue
- How to add hierarchical taxonomy with parent child relation to URL?
- Display a specific hierarchical level of a specific custom taxonomy
- Ideas on how to organize a project [closed]
- WordPress modify Settings > Permalinks (options-permalink.php) Add CPT Permalink Options
- SEO Title Tag and Meta Description for custom taxonomy
- How can I add a custom permalink to a term?
- Permalinks with custom taxonomies and regular categories
- Need equivalent of single_term_slug
- How to define %category% for custom taxonomies?
- Custom Permalink Structure for terms/taxonomies of custom post type
- How Can I Remove Child Slug From Grandchild Slug When Using Duplicate Grandchild Slugs?
- Change the full permalink (URL) of a single post by connecting it to a specific page
- How can I rewrite the URL of my custom taxonomy to include the year?
- How do I get the correct URL?
- Remove custom taxonomy slug from URL
- How to replace custom post type with custom taxonmy in permalinks
- Get taxonomy link with post type slug prefix
- Restructuring permalink with more than one taxonomies
- Custom taxonomy return 404
- Permalinks incorrectly inserting multiple categories
- WordPress Taxonomy Permalinks – Custom?
- How can I add a “fake” parent into the permalink?
- Broken paths on taxonomies after changing permalink to post name
- Permalink Rewrite to include Custom Taxonomy Term
- Multiple taxonomies, what should the permalink look like?
- taxonomy term names in custom post type permalink structure
- Taxonomy to WordPress Permalinks of custom post type
- Most efficient use of custom taxonomies, categories, and pages
- Determine if Term has Grandparent/Great-Grandparent
- Getting grandchildren of a post with a specified custom taxonomy?
- Permalinks not working on MU network with domain mapping
- List child terms and posts in the current term
- Display Parent and child taxonomies in seperate drop downs [duplicate]
- More than one Hierarchical Taxonomy and SEO
- Optional taxonomy in cpt permalink
- post_type_link not working for posts without terms
- Child terms with improper parent in the url should redirect to 404