Pass parameter to custom post type single while keeping clean url

Question

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

0
, R14523 3 days 0 Answers 6 views 0

Thousands of WordPress themes to start your new website with a bang.

Leave an answer