Web sitemde 'profiller' adlı bir kategorim var Bu kategoriyi 'profiller' adı verilen özel bir gönderi türüne taşıma sürecindeyim.
Benim sorunum bu özel yazı türü için göstermek için arşiv sayfası alınamıyor. URL'ye gittiğimde mywebsite.com/profiles
, profiller kategorisindeki bir gönderi için beni tek bir gönderi sayfasına götürür.
Dahil has_archive = true;
ettimfunctions.php
Aynı web sitesinde yaptığım başka bir özel yazı türü için bir arşiv sayfası oluşturmada sorun yaşamadım, bu yüzden neden bu sefer çalışmadığı konusunda gerçekten kayboldum.
Herhangi bir tavsiye en çok takdir edilecektir?
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 */
}