Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

share|improve this question
2  
If you rewrite slug is event your permalinks will begin with event/. So can you please edit your post to show us your correct permalinks? – Abdussamad Oct 13 '12 at 9:06
Where exactly have you asked? I can't find any other questions from you. – kaiser Oct 13 '12 at 15:47
Could you please elaborate? Around this especially - made child pages that work as custom archives. If you are not using native functionality it is impossible to tell what goes wrong. By the way it's currently not clear what is going wrong either. :) – Rarst Oct 13 '12 at 21:24
@kaiser - I meant that other people had asked similar questions on this site. Sorry for the confusion. – user21429 Oct 13 '12 at 23:24
@Rarst - I made a page that holds all of the posts for all of the categories, then I made subpages that act as archives (hold all the posts for specific categories). The subpages are giving 404 errors. – user21429 Oct 13 '12 at 23:26

closed as too localized by Rarst Oct 15 '12 at 22:21

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.