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:

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',
) ); }


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".


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.

  • Thanks for the response. Unfortunately this is not the solution. I am sure Wordpress is edit the .htaccess file. I can see the changes applied as I refresh permalink settings. Also, it's on my local server so I'm sure there are no permission conflicts.
    – psorensen
    Nov 14 '13 at 16:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.