|
I would recommend using a custom taxonomy for this, not a custom field. You can sort and list archives based on a taxonomy far more easily than by custom fields.
However, if you want to list based on the custom field, you're going to need to modify the arguments sent to To add your query variable:
Then, your permalinks for the archive will become something along the lines of Next, you'll need to add whatever value was passed in to your location to the actual query:
I'm assuming you're storing your custom data in a field called
But this will allow you to filter your archives based on a specific location. If you want to enable date-based archives with this as well that will require some additional rules in my first code block (rightw, this would display a list of
all
posts with a Still, I recommend using a custom taxonomy instead. It's cleaner, more extensible, and requires less custom coding. This is also exactly the situation for which custom taxonomies were created ... so please, don reinvent the wheel ... |
| More Solution |
|---|
Reffered: https://wordpress.org/