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
- Restrict custom post type to only site administrator role
- Get custom post type slug for an archive page
- How to force one column layout on custom post type edit page?
- Multiple post types – share same ReWrite slug?
- Search multiple custom fields by using meta_query
- How do I display two separate taxonomy archives for two post types that share a single taxonomy?
- 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?
- How does one delete orphan custom post type?
- Change title in head on Archive page
- Localization For Two Different Regions/Domains with the Same Language
- Add comments meta fields to comments metabox on post edit screen
- Custom Permalinks for Custom post Type Archives?
- is_singular won’t call my functions?
- Custom Post Type with Custom Title
- Pages, Custom Posts & Custom Taxonomy defining slug structure
- How to show a tag archive of one post type only
- Regex problem in an add_rewrite_rule
- Custom taxonomy archive page not working
- How can I customize “Pages” admin (edit.php) and “Edit Page” admin (post.php) for bulk edit of custom content type?
- Custom Post Type by user
- wrong template for page of archive
- Interesting Custom Post Type Slug with Taxonomy and Custom Field
- How to show multiple post types on taxonomy archive?
- same archive template for different custom post
- Custom Post Type post ordering not working
- Custom Post Type with static page for archive
- get_categories for custom post type and filter by custom taxonomy (brand) and list child categories of a defined category
- How do you output custom code between posts in the loop?
- Best practice for adding posts in bulk
- WP 3.1 getting tax_query to work in query_posts()
- wp_get_nav_menu_items wp-admin/customize.php problem
- CPT: archive-cpt.php VS custom page template
- Impossible to get Attachments Outside WordPress?
- Category page only displaying the posts from a custom type
- Display custom post type taxonomies as an archive page
- How does the $post_type global variable work?
- Change name of custom post type archive
- Editable content on a Custom Archive page
- Assigning the same custom meta box to multiple post types
- How to structure a site with product variations pages?
- Custom Page that comes with preloaded content for the user
- get the custom post type title/name
- Get archive post type name
- Filtering WP_Query
- Custom post type – get_day_link()
- Meta query for custom post type ignored in main query
- How do I move/order posts with a tag to the end?
- Use same slug base for Custom Post Type posts, and multiple taxonomy terms
- Custom Path/Folder behind a custom post type
- How do I check if the user is on a taxonomy term parent, child or grandchild page?
- WP_Query custom post type query not showing the exact post type
- How do i search authors from search form using author’s name
- Custom post type / taxonomy rewrite archive page 2 gives 404
- custom post data – how to
- how to remove pages loading with the archive templates
- How to display custom field value on page?
- WordPress custom API endpoint – how to make the request more flexible
- How to rewrite custom taxonomy term archive to use THE SAME SLUG/front as CPT
- Get the link of the first post of a custom taxonomy in a custom taxonomy list
- How can I relate custom post types?
- Create custom WP_List_Table in post_type
- How to hide a custom field from admin?
- Get terms for a specfic post from multiple taxonomies in custom post type
- CMB select with data from CPT
- Is it possible to have hierarchical taxonomy and hierarchical custom post types in one permalink?
- Event Archive by Month
- how to use custom post types collectively integrated with each other
- Problem with customize page cached in WordPress.com [closed]
- Multiple categories assigned to a single product breaking the breadcrumb
- How to achieve a multi-taxomony layout with posts?
- Adding a location field to buddypress activity
- Creating archive like functionality through birectional relationships
- How can I assign multiple parents to CPT?
- Tell wordpress to show a single page instead of an archive page
- Getting 404 on child page with pre_get_posts() on custom posts
- CPT: multiple loops with different terms
- Limit posts per page depending on the size of a div?
- Delete Post by User
- save_post affect creation and deletion
- Set a static page as a user profile page?
- Problem to get the link of the default ‘post’ post type like the orther custom types
- How to display all custom fields associated with a post type – IN THE ADMIN AREA?
- How to keep a CPT stick to specific position?
- Rewriting archive page slug to be different than custom post type slug
- WP_Query for CPT with filter by another WP_Query
- Site loads very slow for archive custom post type page
- How can I set up the URL for a category archive for a custom post type?
- Turn post into simple slideshow
- Problems with a custom meta_box
- How to apply order on custom taxonomy and custom meta key on custom post type
- Query multiple post of which one by taxonomy
- How to make a template for a specific post of a custom post type?
- Bulk update custom post types
- How to create a job post by email parsing? [closed]
- ACF select box css color change
- Creating post custom field text area
- Delete old thumbnail when updating new