내 웹 사이트에 '프로필'이라는 카테고리가 있습니다.이 카테고리를 '프로필'이라는 맞춤 게시물 유형으로 이동하는 중입니다.
내 문제는이 맞춤 게시물 유형에 대해 보관 페이지를 표시 할 수 없다는 것입니다. URL로 이동 mywebsite.com/profiles
하면 프로필 카테고리의 게시물에 대한 단일 게시물 페이지로 이동합니다.
나는 has_archive = true;
내 포함functions.php
동일한 웹 사이트에서 수행 한 다른 사용자 지정 게시물 유형에 대한 보관 페이지를 만드는 데 문제가 없었으므로 이번에는 왜 이것이 작동하지 않는지 실감했습니다.
어떤 조언을 가장 감사하겠습니다?
add_action( 'init', 'profile_custom_init' );
/* Here's how to create your customized labels */
function profile_custom_init() {
$labels = array(
'name' => _x( 'Profiles', 'post type general name' ), // Tip: _x('') is used for localization
'singular_name' => _x( 'Profile', 'post type singular name' ),
'add_new' => _x( 'Add New', 'Profile' ),
'add_new_item' => __( 'Add Profile' ),
'edit_item' => __( 'Edit Profile' ),
'new_item' => __( 'New Profile' ),
'view_item' => __( 'View Profile' ),
'search_items' => __( 'Search Profile' ),
'not_found' => __( 'No Profile found' ),
'not_found_in_trash' => __( 'No Profile found in Trash' ),
'parent_item_colon' => ''
);
// Create an array for the $args
$args = array( 'labels' => $labels, /* NOTICE: the $labels variable is used here... */
'public' => true,
'publicly_queryable' => true,
'has_archive' => true,
'show_ui' => true,
'query_var' => true,
'rewrite' => true,
'capability_type' => 'post',
'hierarchical' => false,
'menu_position' => 10,
'supports' => array( 'title', 'editor','thumbnail', 'excerpt', 'custom-fields' ),
'taxonomies' => array('category')
);
register_post_type( 'profile', $args ); /* Register it and move on */
}
프로파일 카테고리 슬러그를 프로파일 -2와 같은 다른 것으로 변경하십시오.
—
Vinod Dalvi
작동하지 않는 것 같습니다. 또한 예를 들어 404 페이지로 이동하는 대신 URL mywebsite.com/his로 이동하면 ( 'His'라는 페이지 또는 게시물이 없습니다) 'his'라는 단어로 시작하는 게시물로 이동합니다. 이거 정말 이상해?
—
stemie
퍼머 링크 구조를 다시 저장하려고 했습니까? 이로 인해 재 작성 규칙이 재생성됩니다.
—
Mike Madern
Permalink Settings의 Save Changes 버튼을 클릭하여 permalink 구조를 다시 저장하십시오.
—
Vinod Dalvi