EDIT Please ignore this topic. The problem turend out not to be related to wordpress or permalinks at all, but came from a stupid voeding mistrals.
I've defined a wordpress custom post type as followed:
add_action('init', 'fotoalbums_register_posttype');
function fotoalbums_register_posttype() {
register_post_type( 'fotoalbum-item' , array(
'labels' => array(
'name' => 'Fotoalbums',
'singular_name' => 'Fotoalbum',
'menu_name' => 'Fotoalbums',
'all_items' => 'Overzicht',
'add_new' => 'Nieuw album',
'add_new_item' => 'Nieuw album',
'edit_item' => 'Bewerk album',
'new_item' => 'Nieuw album',
'view_item' => 'Bekijk album',
'search_items' => 'Zoek albums',
'not_found' => 'Niet gevonden',
),
'public' => true,
'has_archive' => false,
'show_ui' => true,
'capability_type' => 'page',
'hierarchical' => false,
'supports' => array('title', 'editor') ,
'menu_position' => 31,
'rewrite' => array( 'slug' => 'fotoalbum', 'with_front' => true)
)//end array
); //end register_post_type()
}//end function fotoalbums_register_posttype()
Then I created a page called single-fotoalbum-item.php which is supported to display a single item of this post type. Strange thing is, it does not. Probabply something to do with permalinks, because:
the_permalink(); gives http://kdans.net/e-motion-2012/ and results in a 404 error
the permalink in wp-admin shows http://kdans.net/fotoalbum/e-motion-2012/ , which displays the frontpage template (!!)
I did reserved permalinks multiple times, but some who this problem keeps returning. Where's my mistake?
As did suggested in the comments, here are the rewrite rules.
http://kdans.net/fotoalbum/e-motion-2012/ gives:
index.php?fotoalbum-item=$matches[1]&page=$matches[2] (source fotoalbum-item)
index.php?pagename=$matches[1]&page=$matches[2] (source: page)
index.php?attachment=$matches[1] (source: post)
http://kdans.net/e-motion-2012/ gives
index.php?pagename=$matches[1]&page=$matches[2] (source: page)
index.php?name=$matches[1]&page=$matches[2] (source: post)