Make custom post types and pages place nice, re: rewrite

I have a page structure like such:

  1. Executive Events
    • Annual Conferences
    • Webinars

I also have a custom post type named ‘event’. I have set up the post type so that I get exactly the permalink structure I desire for a single event:

Read More
http://www.mysite.com/executive-events/name-of-single-event (single-post-type)

However, when I go to

http://www.mysite.com/executive-events/annual-conferences (page)

I get a 404. I’ve already refreshed my permalink structure. It seems the rewrite of the CPT is affecting the permalinks of the child pages. Any way around this?

Here is the setup of the custom post type “event” :

add_action('init', 'cptui_register_my_cpt_event');
function cptui_register_my_cpt_event() {
register_post_type('event', array(
'label' => 'Events',
'description' => '',
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'capability_type' => 'post',
'map_meta_cap' => true,
'hierarchical' => false,
'rewrite' => array('slug' => 'executive-events', 'with_front' => 1),
'query_var' => true,
'supports' => array('title','editor','excerpt','trackbacks','custom-  fields','revisions','thumbnail','author','page-attributes','post-formats'),
'taxonomies' => array('event-type'),
'labels' => array (
  'name' => 'Events',
  'singular_name' => 'Event',
  'menu_name' => 'Events',
  'add_new' => 'Add Event',
  'add_new_item' => 'Add New Event',
  'edit' => 'Edit',
  'edit_item' => 'Edit Event',
  'new_item' => 'New Event',
  'view' => 'View Event',
  'view_item' => 'View Event',
  'search_items' => 'Search Events',
  'not_found' => 'No Events Found',
  'not_found_in_trash' => 'No Events Found in Trash',
  'parent' => 'Parent Event',
)
) ); }

Thanks!

Edit: I can get the desired effect if I change my permalink structure to default, but run into the problem when I switch the structure to “post name”.

Related posts

1 comment

  1. Was wordpress able to create it’s .htaccess file? If not, copy the contents of the example from below the permalink options to your .htaccess in the root of your ftp.

Comments are closed.