Header is not displaying on certain pages of wordpress theme

First time making a wordpress theme. I can’t seem to get my header to display on certain pages (archive.php). It displays perfectly fine on my front page, etc. Just not in the archive or individual posts. My code is below…


<?php get_header();?> <div class="container">  <h1><?php single_cat_title();?></h1>  <?php if (have_posts()) : while(have_posts()) : the_post();?>   <div class="card mb-4">     <div class="card-body">     <?php if (has_post_thumbnail()):?>  <img src="<?php the_post_thumbnail_url('smallest');?>" class="img-fluid">  <?php endif;?>     <h3><?php the_title();?></h3>     <?php the_excerpt();?>     <a href="<?php the_permalink();?>" class="btn btn-success">Read more</a>     </div>     </div> <?php endwhile; endif;?>  </div> <?php get_footer();?> 


<?php get_header();?> <div class="container">  <h1><?php the_title();?></h1>  <?php if (have_posts()) : while(have_posts()) : the_post();?>      <?php the_content();?>  <?php endwhile; endif;?>  </div> <?php get_footer();?> 


<!DOCTYPE html> <html <?php language_attributes(); ?>>         <head>             <?php wp_head(); ?>             <div class="logo">     <img class="logo" src="img/pmflogolandscapedemo_crop.png" width="100%" alt=""> </div>     </head>  <body <?php body_class(); ?>>         <header>  <div class="container">     <?php wp_nav_menu (          array(              'theme_location' => 'top-menu',             'menu_class' => 'navigation'          )      );     ?> </div>  </header> 

Is there a different file in the theme that might be causing this? I can’t seem to spot any issues between this page and other ones like my front-page.php, where the header displays fine.

Thanks in advance for any assistance, I’m really struggling with the basics here.