When you have Pages with children, the permalink structure works something like this:
All well and good. Trying to go to this URL:
doesn't work, which is good, and as expected - I only want the one URL for my child page.
However, I've set up a custom post type, and set it to be hierarchical, so as to behave like pages. It doesn't quite work the same way:
works as expected, but removing the parent page from the URL:
also displays the child page. It should 404, I would have thought.
I've used the following args to register_post_type:
$args = array( 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'query_var' => true, 'rewrite' => array('slug'=>'custom-post-type','with_front'=>false), 'capability_type' => 'post', 'has_archive' => false, 'hierarchical' => true, 'menu_position' => null, 'supports' => array('title','editor','thumbnail','excerpt','revisions','page-attributes') );
It's entirely possible I've misunderstood some of the options though. Can someone tell me if I'm doing something wrong, or if this is a bug or a feature?
I'm using 3.2.1, with no plugins, just my custom theme.