Senin içinde register_post_typeçağrı, emin bu argümanlar var olun:
register_post_type(
'my_post_type',
array(
'hierarchical' => true,
'public' => true,
'rewrite' => array(
'slug' => 'my_post_type',
'with_front' => false,
),
'supports' => array(
'page-attributes' /* This will show the post parent field */,
'title',
'editor',
'something-else',
),
// Other arguments
)
);
Kalıcı bağlantılarınızın temizlendiğinden emin olun (Ayarlar> Kalıcı Bağlantılar sayfasını ziyaret edin).
Şimdi yeni bir tane oluşturduğunuzda my_post_type, üst öğesini başkasına ayarlayın ve kalıcı bağlantı aşağıdaki gibi görünecektir:
http://example.com/parent-post-type/my-post-type/
İhtiyacınız olduğu kadar çok seviyeye gidebilirsiniz.