I'm trying to develop my first wordpress themes, but now I have a quite weird problem. My singular.php page seems to not work. whatever I put in the page doesn't show up. as if the wordpress core doesn't recognize the file. while I used the same content for another theme for the same website and it worked properly.
It doesn't even show my header and footer. and when I inspect the page it's completely empty!
I tried setting the index.php file, but the same result was there :( nothing to show.
the content of the page is:
<!DOCTYPE html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <?php get_header();?>
</head>
<body>
<?php get_template_part('template-parts/header/header-bar');?>
<?php
if (have_posts()):
  while (have_posts()) : the_post();
    the_content();
  endwhile;
else:
  echo '<p>Sorry, no posts matched your criteria.</p>';
endif;
?>
<?php get_footer();?>
</body>
</html>
UPDATE
for some reason, this content works in page.php, I don't know why singular.php and index.php don't work. according to wordpress Template Hierarchy they should show the content in case of existence.
