0

What I have is

  1. Created a new page with slug monuments
  2. 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?

5
  • Unless there's more than you describe, it sounds to me like city should be a taxonomy. If you did that, what you're asking is very simple, see this question for details. May 29, 2013 at 13:23
  • No, city is a custom post type. I think that add_rewrite_rule might do the trick. But I don't understand yet the whole procedure.
    – panos
    May 29, 2013 at 18:06
  • I forgot to mention that each custom post type "monument" has a "city" parent. I have included that part in my question.
    – panos
    May 29, 2013 at 18:16
  • Sorry that this was unclear, I was suggesting that you consider making city a taxonomy. Otherwise, you'll need to do something like here: wordpress.stackexchange.com/questions/99378/… May 29, 2013 at 18:32
  • I see that there are alot of things I need to learn. I have also made some big mistakes, like giving at the CPT "monument" slug "monuments" which is the same slug that the page monuments has... We can just leave it as it is, and when I have more time for reading I'll come back with it. Thank you @Matthew
    – panos
    May 29, 2013 at 19:21

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy