I have a custom post type
// Set other options for Custom Post Type
$args = array(
'label' => __( 'document', 'ecse' ),
'description' => __( 'Upload Documents', 'ecse' ),
'labels' => $labels,
// Features this CPT supports in Post Editor
'supports' => array( 'title', 'editor', 'custom-fields', 'excerpt' ,'thumbnail','page-attributes','tags'),
// You can associate this CPT with a taxonomy or custom taxonomy.
'taxonomies' => array( 'sources' ),
'capability_type' => 'page',
And I have custom taxonomies for it
register_taxonomy( 'sources',...[ ... 'has_archive' => true,
'rewrite' => [
'hierarchical' => true,
"with_front" => false,
'ep_mask' => EP_PERMALINK | EP_PAGES,
'slug' => '/%sources%/'
register_taxonomy( 'forms', 'documents',[
'has_archive' => true,
'hierarchical' => true,
'rewrite' => [
'hierarchical' => true,
"with_front" => false,
'ep_mask' => EP_PERMALINK | EP_PAGES,
'slug' => '/documents/%postname%/'
],
'show_in_menu' => false,
'query_var' => true,
]);
I'm able to get the archive page to display a paginated list of the post type.... But the permalink for the single post type is being malformed
The base for my taxonomy permalink is http://xxxx/documents/%sources%/
where sources is the taxonomy if I use http://xxxx/documents/%sources%/%postname%/
Then the single page works....but I lose the "archive pagination" thus http://xxxx/documents/%sources%/page/2/
doesn't work.
How do I get both sinlge and archive pages to work for custom post types?
documents
?) and rewrite parameters are used inregister_post_type()
?