I asked the question too soon. And thanks to @Jan Fabry for pointing me in the right direction.
In case anyone else has this problem, here’s the answer.
Any time the rewrite rules are changed (adding a new post type, changing the slug or the has_archive slug, etc.) you have to call flush_rewrite_rules
once. It has to be called after the post types are registered. I put it at the very end of my function which registered the post types on ‘init’, visited the site once, then deleted it out. Now the site works fine.
Related Posts:
- WP 3.1 – archive pages for custom content types possible now without a plugin?
- Need to have an archive widget which organizes and displays a custom post type using a custom date field
- What does this PHP function code mean? [closed]
- How to create a custom search for custom post type?
- what is the correct way to compare dates in a WP query_posts meta_query
- How do you use a CPT as the default home page?
- Can a custom post type have a Parent Page?
- Restrict custom post type to only site administrator role
- Custom Post Type Archives by Year & Month?
- Creating an Image-Centric Custom Post Type?
- Get custom post type slug for an archive page
- don’t publish custom post type post if a meta data field isn’t valid
- Correctly delete posts with meta and attachments [duplicate]
- Custom post type pagination 404 fix?
- How do I append multiple taxonomies to the URL?
- Why are the comments disabled by default on my custom_post_types?
- Adding content to archive and taxonomy pages on custom post types?
- Linking Two Post Types
- Filtering a custom post type by custom taxonomy in archive template
- Permalink Structure for Multiple Post Type Archives by Taxonomy
- get term archive url / link
- Prevent pre_get_posts filter on specific post type
- How to get the custom post type from an archive page?
- How to force one column layout on custom post type edit page?
- How to remove “Archive:” label from archive title
- How to set a default format for a custom post type?
- Multiple post types – share same ReWrite slug?
- Why are posts from custom post type not displayed in “category” archive?
- Custom Post Types on Category Pages
- Custom Post Type Archives by Date and Taxonomy
- Displaying category archive of custom post types
- Setting Default Category for Custom Post Type Upon Autosave
- Custom post types – Use post_id in permalink structure when using has_archive => true
- Creating “static” taxonomies to choose from, inside custom post type?
- How to change “Draft” string for status of custom post type to “Unavailable”?
- Meta_Query as a way how to setup CPT permalinks – is it a good thing?
- WordPress Custom Post Types with a page as a parent?
- Search multiple custom fields by using meta_query
- $query->set in pre_get_posts is unintentionally affecting the backend
- Custom post status not working
- Pagination throws 404 error on custom taxonomy archive pages
- How do I filter the excerpt metabox description in admin?
- Proper way of making custom post type landing page or archive page
- How do I display two separate taxonomy archives for two post types that share a single taxonomy?
- Custom Post Type Archives by Date with Custom Permalink
- Filter for “get_post_type_archive_link()”
- How to add meta box to backend menu page
- How to Remove Certain Screen Options and Table Columns from post type in wp_list_table?
- Custom Taxonomy with Custom Post Type Finds No Posts
- Best Way to Create a List of Musician Gigs in WordPress
- Custom Post Type Archive Page: Set Posts Per Page, Paginate
- Get custom post type by category in a page template
- How does one delete orphan custom post type?
- Associating an “author” with a custom taxonomy
- Change title in head on Archive page
- Display Editable Text Above CPT Archive Listings
- Custom Post Type Archives with 0 Posts Redirects as 404
- How to show more posts on an archive page?
- Archive page with multiple taxonomies rewrite
- Redirect after deleting post and keep track of pagination
- Multiple Paginations on one Page
- Create permalink structure for one taxonomy archive per custom post type
- Archive page…limiting posts per page
- Page is defaulting to archive page and not designated template
- Admin Post Update Redirection to Posts Screen
- add_rewrite_rule and custom variable
- Date archives for custom post type
- modify all posts of a category to “no comments allowed”
- TV Show database – Best way for structuring it?
- Custom Post Type Archive URL takes over page URL
- Add custom field to media attachment image attribute in post editor
- Custom comment status possible?
- Better to use a post type archive, page template, or shortcode for generating a highly configurable CPT archive?
- Display all custom post types in archives.php
- Why is the »_builtin« parameter not advised in »register_post_type()« for custom post types?
- How to Add Pages Under Custom Post Type URL Structure?
- How to not allow custom roles to edit published custom post types?
- Delete all the custom post types when deleting user
- Localization For Two Different Regions/Domains with the Same Language
- Custom Post Type Archives by Date (stored as meta value) WP3.1
- Correct way to use a form to to filter custom posts by taxonomy terms?
- WordPress custom post type category pagination 404 Error
- Assign Page Template Within A Custom Post Type
- Showing current taxonomy terms
- Add comments meta fields to comments metabox on post edit screen
- Custom Permalinks for Custom post Type Archives?
- Removing Image Sizes for Custom Post Type
- White screen error for a custom theme
- is_singular won’t call my functions?
- How to override parent theme function through the child theme [closed]
- Show Custom Post Type by Author
- Custom Post Type with Custom Title
- Custom post type archive with pagination?
- Custom post type tag archives don’t work for basic loop?
- automatically create taxonomy with same name as post title
- Removing CPT slug from URL results in 404 error for archive page
- Multiple post types in archives (filter?)
- How to add a select menu to this metabox code?
- Pages, Custom Posts & Custom Taxonomy defining slug structure
- Query posts by custom post type and custom taxonomy