Site icon Hip-Hop Website Design and Development

Custom post type slug as page slug

I have a custom page type dictionary and all of the dictionary items have URLs like this: example.com/dictionary/item

dictionary has has_archive => false

The problem occurs if I also create a page called Dictionary with an URL example.com/dictionary

Now, all of the dictionary item pages are giving me an 404 error.

CPT was created using CPT UI


So, my question is: how to make it so that example.com/dictionary would show a page called “Dictionary” (not an archive) and that all of the items would show on their URLs, example: example.com/dictionary/item-1 and not show a 404 error instead.

I refreshed permalinks by going settings -> permalinks, and hitting save.