I created a WordPress theme from scratch with custom post type. Everything is working fine except the page.php
When i open any page like sample-page it loads index instead of page template (page.php) until you change your permalinks to %post_id%. When i switch to another theme everything works fine even with permalinks set to %postname% which means problem is in my custom theme. I google a lot, update permalinks, changed page.php to static cleared cache and tried everything i know but didn’t find any solution.
(Currently I am using XAMMP with WordPress module, On Windows 10)
Read more here:: My WordPress Custom Theme Loading Index instead of page