내 웹 사이트의 각 섹션에 대해 다른 유형의 게시물을 만들려고하는데 막혔습니다. 그것은 패널 정보의 왼쪽 사이드 바에서 보여WordPress 분류 체계 페이지가 작동하지 않습니다.
function create_post_type() {
register_post_type('information',
array(
'labels' => array(
'name' => __('Information'),
'singular_name' => __('Information')
),
'public' => true,
'has_archive' => true,
'rewrite' => array('slug' => 'information'),
'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt'),
'menu_icon' => 'dashicons-admin-post',
)
);
}
add_action('init', 'create_post_type');
add_action('init', 'build_taxonomies', 0);
function build_taxonomies() {
register_taxonomy(
'information',
'information',
array(
'hierarchical' => true,
'label' => 'Type',
'query_var' => 'information',
'rewrite' => array('slug' => 'type')
)
);
}
/I는 이후 모든과 기사를 참조하십시오 내 웹 사이트에서 새/유형
을 추가
이
내가 지금까지 무엇을 가지고 '유형'을 등록했습니다.나는 예를 들어 볼 필요가 : mywebsite.com/information/daily
-> 목록 매일 분류와 표시 정보의 모든 게시물.
는입니다 그 : mywebsite.com/customposttype/taxonomy
사실내가 루프와 분류 - information.php을 가지고 있지만 그것은 홈페이지에 나를 보낸다 (시도 분류-type.php, 분류 정보 -type.php, 아무도 작동하지 않습니다).
내가 뭘 잘못하고 있니?
나는 그것을 시도, 성공하지 못했습니다. 카테고리 및 하위 카테고리가있는 일반 게시물을 사용하여 끝났습니다 ... 분류 및 게시물 유형에 대해 스택 오버플로에서 '정보'로 변경했습니다. 이는 내 코드에서 다른 언어로 된 단어를 사용했기 때문입니다. 답장을 보내 주셔서 감사합니다. –