[wp-hackers] 404 for nested page and custom post type

John Blackbourn johnbillion+wp at gmail.com
Thu Oct 20 00:53:43 UTC 2011


On 20 October 2011 01:44, Alex Hempton-Smith <hempsworth at gmail.com> wrote:
> Hi all,
>
> I have a custom post type set up, with the following permalink structure: *
> example.com/people/my-post*
> I also have two pages, one with the permalink *example.com/people* and a
> child page at *example.com/people/new*
>
> I'm trying desperately to create a custom template for the child page, but
> when I visit the page, I receive a 404 error.
>
> Clearly this is due to a rewrite mixup between the custom post type, and the
> page.
>
> How do I manage this do you think?

If you explicitly know the page URLs then you can override the rewrite
rules for those particular pages. Here's what I use:
http://pastebin.com/kTrU2C6G


More information about the wp-hackers mailing list