I created a very small plugin using a Custom Post Type
.
This is NOT a commercial or publicly available plugin, only my website is using it.
What happens:
when I click the name of a user who posted a post, I should eventually get a page containing the list of the titles of the posts he posted: I get a 404 page;
when I click any monthly archive of posts I get a 404 page, EXCEPT when a document of my custom post type is present in the list;
When I disable my plugin, 404 error goes away.
I red anything about flushing permalinks, but nothing changed: once the plugin is activated, I get the 404 error.
I can eventually post all the code, but I noticed many posts where the relevant part is the following:
function add_DeltaDocuments_custom_post_type()
{
unregister_post_type('docs');
$labels = $this->set_ui_labels('DeltaDocument', 'DeltaDocuments');
register_post_type('docs', array(
'labels' => $labels,
'public' => true,
'has_archive' => true,
'menu_icon' => 'dashicons-text-page',
'exclude_from_search' => false,
'taxonomies' => ['category'],
'rewrite' => array('slug' => 'docs'),
'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'custom-fields', 'revisions'),
)
);
}
Any help is appreciated.