I have developed a plugin on one site and just now moved it to another. At start I had that problem in the initial site too. Saving permalinks again solved it in the initial website.
I then moved it to the new website and I am getting it again. I tried to save the permalinks settings again but it isn't helping.
I saw multiple solutions but none solved the issue.
This is how I create the custom post type:
register_post_type( 'ossp',
array(
'labels' => array(
'name' => __( 'Sale Page' ),
),
'rewrite' => array( 'slug' => 'sale-page', 'with_front' => false ),
'public' => true,
'hierarchical' => true,
'has_archive' => true,
'publicly_queryable' => true,
'supports' => array(
'title',
// 'page-attributes',
'editor',
'excerpt',
'thumbnail',
),
)
);
If any more information is needed, tell me and I'll edit the question.
Thanks!