Title: loop within page template doesn&#039;t display posts
Last modified: August 20, 2016

---

# loop within page template doesn't display posts

 *  [captainShenanigan](https://wordpress.org/support/users/captainshenanigan/)
 * (@captainshenanigan)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/loop-within-page-template-doesnt-display-posts/)
 * hey everyone. i kinda get the feeling that this is a super-easy question, but
   i’m clearly just not seeing something.
 * basically in my index.php i have a basically filtered loop, displaying only posts
   with a certain category (this loop is the one below)
 * i’ve created a second page (which is based on a page template) for other posts,
   that basically filters out all the ones contained within the index.php loop. 
   this loop is identical to the index.php one in every way, with the exception 
   of queries.
 * my issue is that this page isn’t displaying anything. no posts, no “content could
   not be found” message. just my standard “page.php” content layout.
 * i’m convinced that this is a very basic issue, i’m probably just missing something;
   iv’e not been doing this long and am still learning the ropes. any help would
   be fantastic.
 * thanks!
 *     ```
       <?php get_header(); ?>
   
       <div class="navigationWrap">
         <?php get_sidebar(); ?>
       </div>
       <div class="content">
         <?php query_posts($query_string . '&cat=103'); ?>
         <?php
       if ( have_posts() ) : while ( have_posts() ) : the_post();
       ?>
         <div class="galleryPost">
           <div class="galleryHeading">
             <h2>
               <?php the_title(); ?>
             </h2>
           </div>
           <div class="galleryPostInfo"><span> Posted on
             <?php the_time('F jS, Y') ?>
             | Posted as
             <?php the_category(', ') ?>
             | Posted by
             <?php the_author_posts_link(); ?>
             <?php the_tags(' | Tagged as: ', ', ', ''); ?>
             </span> </div>
           <div class="galleryPostContent">
             <?php the_content('more'); ?>
           </div>
         </div>
         <?php endwhile; else: ?>
         <h2>Sorry, no posts matched your criteria.</h2>
       </div>
       <?php endif; ?>
       <div class="clear"></div>
       </div>
       <?php get_footer(); ?>
       ```
   

Viewing 1 replies (of 1 total)

 *  Thread Starter [captainShenanigan](https://wordpress.org/support/users/captainshenanigan/)
 * (@captainshenanigan)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/loop-within-page-template-doesnt-display-posts/#post-2974354)
 * quick update; after a little bit of fidding, i’ve determined that for some reason
   it’s almost like the page’s attributes are overriding those within the loop.
 * for example, the_title isn’t the title of a blog post, it’s the page’s title.
   the_content isn’t the post content, it’s the page’s content. bizarrely, this 
   is still the custom page template’s layout, as there are elements present in 
   that page that aren’t present within the page.php document.
 * if any of that helps my cause…
 * thanks
 * maybe…do i need to add some kind of reset to the bottom of the index.php loop?

Viewing 1 replies (of 1 total)

The topic ‘loop within page template doesn't display posts’ is closed to new replies.

## Tags

 * [category](https://wordpress.org/support/topic-tag/category/)
 * [displayed](https://wordpress.org/support/topic-tag/displayed/)
 * [filter](https://wordpress.org/support/topic-tag/filter/)
 * [loop](https://wordpress.org/support/topic-tag/loop/)
 * [not](https://wordpress.org/support/topic-tag/not/)
 * [page](https://wordpress.org/support/topic-tag/page/)
 * [second](https://wordpress.org/support/topic-tag/second/)
 * [template](https://wordpress.org/support/topic-tag/template/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [captainShenanigan](https://wordpress.org/support/users/captainshenanigan/)
 * Last activity: [13 years, 9 months ago](https://wordpress.org/support/topic/loop-within-page-template-doesnt-display-posts/#post-2974354)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
