Hoping you can help with this...
WE have a 'serivces' custom post type that allows a 'service' to have a parent 'service'. Our custom rewrite rule works for top-level services but not child services.
The url structure would be something like the following where 'test-service' and 'test-service-child' are the post names:
- consultancy/test-service
- consultancy/test-service/test-service-child
Our existing rewrite rule is as follows:
add_rewrite_rule('^consultancy/(.*)/?', 'index.php?post_type=service&name=$matches[1]', 'top');
Can anyone suggest a modification that will get the post name from the end of the url? Eg in the case of the examples above it should match the following
- test-service
- test-service-child
Any help greatly appreciated. Thanks in advance,
Will