Pass parameter to custom post type single while keeping clean url

I’m working on passing a get parameter to a single custom post type in a clean url. So for instance there would be the custom post type ‘services’ which would have the single post ‘gardening’.

/services/gardening/leeds

which would translate to the following so the variable is accessible on the template:

/services/gardening?location=leeds

but still show as the following in the browser:

/services/gardening/leeds

I just wondered if anyone had done that before using custom post types?

Thanks

Read more here:: Pass parameter to custom post type single while keeping clean url

Leave a Reply

Your email address will not be published. Required fields are marked *