Search code examples
wordpresscustom-post-typepermalinks

Permalinks with Custom post type and Children pages


I have a problem with Wordpress. I have a Custom post type called "que-visitar", another custom post type called "zonas", and two pages, called "La casa" and "Que visitar". And a page called "Cultural" who is child of "Que visitar". If I go to http://mypage.com/que-visitar/cultural/, it have to show me the "Cultural" page. And if I go to http://mypage.com/zonas/{zone-1}/ it have to show me the zone-1, a post created in the custom post type "zonas".

The problem is, when I go to "zonas" url it shows an error (404), but if I go to "culutal" url works fine. Then, I go to the admin, in Permalinks options, I save and the "zonas" url works, but "cultural" doesn't. I put in functions.php flush_rewrite_rules(false); and the "cultural" links works but "zonas" doesn't. And always the same.

What problem can be happend?

Thank you.


Solution

  • I fixed it. The slug for de custom post type "que-visitar" was "que-visitar", and the slug for de page "Que visitar" was "que-visitar" too. I changed the slug for the custom post type and flush, and it works.