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

--------------------------------------------------

>>> Share a link to this question, just copy and paste the code bellow on your web page <<<

<a href="https://www.wptricks.com/question/pass-parameter-to-custom-post-type-single-while-keeping-clean-url/">

Pass parameter to custom post type single while keeping clean url</a>
0
, R14523 4 months 0 Answers 23 views 0

Leave an answer