Include page name in posts slug
I have created a custom page template with option to select a tag from posts Categories to query the respective posts with that tag when the page is opened.
Page with name Trips are created, custom template selected and also category tag Trips is selected.
Page is then added to the menu under About Us menu item.
When I open the page site.com/about-us/trips/ A custom template are loaded with all the posts with term Trips.
When I open the post, the URL of the post is site.com/trips/post-slug where "trips" are the category tag slug.
Is there any option for those posts to include their "parent" page slugs like in this example it would be site.com/about-us/trips/post-slug ?
I could set the category base as ‘about-us’, but that is not a solution because there could be multiple pages with that custom template and another category tag selected f.e. site.com/about-us/interviews/post-slug
I am sorry, I have no code example for what I have done so far as I dont even know where to start 🙂