I have a CPT which saves a location and and its slug into wp_postmeta
table. The location is selected from a dropdown in CPT edit page and it is not a taxonomy.
Now I want to create a custom template which needs to understand the value I am passing through the URL such as .
The part himachal-pradesh
is my location slug and I want to pull posts which has the same value in wp_postmeta
table.
I have created a custom template and can use it to create a new page (), but it will actually have the location slug which is dynamic for each location.
What is the right way to achieve this?