EDIT이 주제를 무시하십시오. 문제는 워드 프레스 나 퍼머 링크와는 전혀 관련이 없지만 어리석은 착취의 실수에서 비롯된 것입니다. 다음으로Wordpress 커스텀 포스트 타입은 프론트 페이지를 사용합니다
나는 워드 프레스 사용자 정의 포스트 유형을 정의했습니다 :
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()
그런 다음이 게시물 유형의 단일 항목을 표시하는 데 지원되는 단일 Fotoalbum 사이트-item.php라는 페이지를 만들었습니다. 이상한 일은 그렇지 않습니다. permalinks와 관련이 있습니다. 이유는 다음과 같습니다.
the_permalink(); http://kdans.net/e-motion-2012/ 제공하고
WP - 관리자의 고유 주소가 FrontPage를 템플릿을 표시 http://kdans.net/fotoalbum/e-motion-2012/ (!)
내가 소유 않았다 영구 링크를 여러 번 보여
하지만,이 문제는 계속 몇 가지 404 오류가 발생합니다 돌아 오는 중. 내 실수는 어디 갔어?
의견에서 제안한대로 다음은 다시 쓰기 규칙입니다.
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)
여러 번 시도했습니다. 운이 없으면 지금까지 –