Site icon Hip-Hop Website Design and Development

Category-specific loop not working

This is my site, we’re remodeling an nonprofit’s website for class (it has no affiliation with the actual organization). On this page: https://dev-hopeproject.pantheonsite.io/news/ there is supposed to be a loop that displays content from a specific category "News", with ID 3.

This is newsfeed.php:

$posts = query_posts($query_string.'&cat=3');  ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
  <h1><?php the_title();?></h1>
  <p><?php the_content();?></p>
<?php
endwhile;
endif; ?>
</div>

This gets called by index.php in the following if-else:

<?php
if (is_page( 'home' ) ):
  include('loop.php');
  include('buttons.php');
  include('recent-articles.php');
elseif (is_page('news')):
  include('newsfeed.php');
  dynamic_sidebar('home_right_1');
endif;
?>
<!-- <?php get_sidebar(); ?> -->
<?php get_footer(); ?>

Weirdly enough, although it’s almost identical to what I’m doing on the homepage with recent-articles.php,

<div id="aboutwrap"><?php global $query_string;
$posts = query_posts($query_string.'&cat=2');  ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
  <h1><?php the_title();?></h1>
  <?php the_content();
endwhile;
endif; ?>
</div>

newsfeed’s content isn’t appearing. In fact, it’s specifically displaying the title of the page, "News", rather than the title of the only post in that category, which is "Covid Updates".

My professor is probably right that all these loops are making the site screwy, but why two near-identical loops wouldn’t work on the same site is nagging me. Any thoughts?