WordPress Developer Ukraine, Kyiv
Add Taxonomy Term Name to Custom Post Type Permalink Slug

Add Taxonomy Term Name to Custom Post Type Permalink Slug

By default, the permalink for a custom post type (CPT) looks like /resources/post-title/. If you want the taxonomy term to appear in the URL — /resources/term-name/post-title/ — you need to replace the rewrite slug’s placeholder at permalink generation time and register a matching rewrite rule so WordPress can resolve those URLs.
WordPress: Add Parent Term Slug to Child Term URL

WordPress: Add Parent Term Slug to Child Term URL

By default, hierarchical taxonomy terms do not include the parent slug in their URL. A child term “Lorem” under a parent “Test” has the URL /lorem/, not /test/lorem/. Adding the parent slug creates cleaner, more descriptive URLs that reflect the taxonomy hierarchy.