What I have is
- Created a new page with slug
monuments
- Created a template file at my theme's folder that will show all records with post_type
monument
.
[UPDATE] 3.I forgot to mention that each custom post type "monument" has a "city" parent [/UPDATE]
What I want to do is, in that same file, to add a list of cities links, and when clicking on any of the cities, it will display only the monuments of that city.
I already have a custom post type city
.
The URL I want it to display, when clicking on a city's link, is
http://example.com/monuments/city-slug
Is that possible with add_rewrite_rule
?
city
should be a taxonomy. If you did that, what you're asking is very simple, see this question for details.city
a taxonomy. Otherwise, you'll need to do something like here: wordpress.stackexchange.com/questions/99378/…