{"id":10837721,"date":"2018-11-01T12:13:26","date_gmt":"2018-11-01T12:13:26","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/allow-hierarchical-slug-support-for-use-with-categories\/"},"modified":"2018-11-02T10:22:02","modified_gmt":"2018-11-02T10:22:02","slug":"allow-hierarchical-slug-support-for-use-with-categories","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/allow-hierarchical-slug-support-for-use-with-categories\/","title":{"rendered":"Allow hierarchical slug support for use with categories"},"content":{"rendered":"<p>As you can see in the example below the hierarchy of categories can become quite complex. <\/p>\n<pre><code>Men\r\n    Tops\r\n        Dress shirt\r\n        Polo shirt\r\n        T-shirt\r\n    Trousers\r\n        Overalls\r\n        Cargo\r\n        Denim\r\n    Shoes\r\n        Trainers\r\n        Sandals\r\n        Smart shoes\r\n        Boots\r\nWomen\r\n    Tops\r\n        Dress shirt\r\n        Polo shirt\r\n        T-shirt\r\n    Trousers\r\n        Overalls\r\n        Cargo\r\n        Denim\r\n    Shoes\r\n        Trainers\r\n        Sandals\r\n        Smart shoes\r\n        Boots\r\n\r\nChildren\r\n    Tops\r\n        Dress shirt\r\n        Polo shirt\r\n        T-shirt\r\n    Trousers\r\n        Overalls\r\n        Cargo\r\n        Denim\r\n    Shoes\r\n        Trainers\r\n        Sandals\r\n        Smart shoes\r\n        Boots<\/code><\/pre>\n<p>At the moment WordPress is designed to have unique slugs so with a three-level hierachy such as<\/p>\n<pre><code>Mens\r\n    Tops\r\n        Polo shirt<\/code><\/pre>\n<p>the URL\/slug would result in this for example:-<br \/>\nwww.domain.com\/category\/mens\/mens-tops\/mens-tops-polo-shirt<\/p>\n<p>A more ideal friendly URL\/slug would be:-<br \/>\nwww.domain.com\/category\/men\/tops\/polo-shirt<\/p>\n<p>My knowledge of WordPress is very basic but I am aware of the functions.php file. Is there any functions I can use to change the bahaviour of WordPress so it allows categroies and slugs to have the same name so long as the parent is unique? If not can I make a suggestion for a future build?<\/p>\n<p>Many thnaks<\/p>\n<p>Will<\/p>\n","protected":false},"template":"","class_list":["post-10837721","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/10837721","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/10837721\/revisions"}],"predecessor-version":[{"id":10837724,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/10837721\/revisions\/10837724"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=10837721"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}