It's been asked a number of times on here, but none of the answers given worked for me so I thought I'd try to give the specifics of my case and see if I can get it sorted out.
I have three custom post types working on a site, each of which uses categories to sort the content. The landing pages and the post pages are working just fine, but I've made child pages that work as custom archives and they are giving 404 errors when I change the permalinks from DEFAULT to anything else.
So to be a little more specific:
site/event/ - works
site/event/article-name/ - works
site/event/archive/ - 404 error
The code I'm working with:
add_action('init', 'register_post_type_events');
function register_post_type_events() {
register_post_type('event', array(
'labels' => array(
'name' => 'Events',
'singular_name' => 'Event',
'add_new' => 'Add new event',
'new_item' => 'New event',
'view_item' => 'View event',
'search_items' => 'Search events',
'not_found' => 'No events found',
'not_found_in_trash' => 'No events found in Trash'
),
'public' => true,
'menu_position' => 4,
'_builtin' => false,
'capability_type' => 'post',
'hierarchical' => true,
'rewrite' => array('slug' => 'event'),
'query_var' => true,
'supports' => array(
'title',
'editor',
'page-attributes',
'author'
),
'taxonomies' => array('category', 'post_tag')
));
}
Any ideas?
** Update ***
I found a workaround for this one. I added /article to the slug ('rewrite' => 'event/article') and that seemed to do the trick. Not an ideal solution, but it works in my case.