Title: Loop Problems
Last modified: August 19, 2016

---

# Loop Problems

 *  [feefergross](https://wordpress.org/support/users/feefergross/)
 * (@feefergross)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/loop-problems-1/)
 * Below is the code for my index page. What I am trying to do is have one loop 
   that pulls from one cat and one that pulls from another. I have followed every
   tutorial i can find here and in the codex, but seem to be missing something really
   small. Help?
 *     ```
       <?php get_header(); ?>
               <div id="waxpaper">
   
       	<div id="content" class="narrowcolumn">
   
       	<?php query_posts('showposts=1&cat=1'); ?>
           <?php while (have_posts()) : the_post(); ?>
   
       			<div class="post" id="post-<?php the_ID(); ?>">
       				<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
       				<small><?php the_time('F jS, Y') ?> by <?php the_author() ?></small>
   
       				<div class="entry">
       					<?php the_excerpt(); ?>
       				</div>
   
       				<p class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?>  <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
       	  </div>
   
       		<?php endwhile; ?>
       <div>
   
       <?php query_posts('showposts=1&cat=2'); ?>
           <?php while (have_posts()) : the_post(); ?>
   
       			<div class="post" id="post-<?php the_ID(); ?>">
       				<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
       				<small><?php the_time('F jS, Y') ?> by <?php the_author() ?></small>
   
       				<div class="entry">
       					<?php the_excerpt(); ?>
       				</div>
   
       				<p class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?>  <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
       			</div>
   
       		<?php endwhile; ?>
   
       		<div class="navigation">
       			<div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
       			<div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
       		</div>
   
       	<?php else : ?>
   
       		<h2 class="center">Not Found</h2>
       		<p class="center">Sorry, but you are looking for something that isn't here.</p>
       		<?php include (TEMPLATEPATH . "/searchform.php"); ?>
   
       	<?php endif; ?>
       	</div>
   
       <?php get_sidebar(); ?>
   
              </div>
   
       <?php get_footer(); ?>
       ```
   

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [feefergross](https://wordpress.org/support/users/feefergross/)
 * (@feefergross)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/loop-problems-1/#post-835384)
 * The error I get is: **Parse error: syntax error, unexpected T_ELSE in /home/rawfully/
   public_html/wp-content/themes/default/index.php on line 44**
 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [17 years, 10 months ago](https://wordpress.org/support/topic/loop-problems-1/#post-835385)
 * You have an else that is seemingly going unused.
 * Get rid of this bit entirely:
 *     ```
       <?php else : ?>
   
       		<h2 class="center">Not Found</h2>
       		<p class="center">Sorry, but you are looking for something that isn't here.</p>
       		<?php include (TEMPLATEPATH . "/searchform.php"); ?>
   
       	<?php endif; ?>
       ```
   
 *  Thread Starter [feefergross](https://wordpress.org/support/users/feefergross/)
 * (@feefergross)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/loop-problems-1/#post-835386)
 * Ok, that got the site working again, BUT, I am still only seeing one WordPress
   loop.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Loop Problems’ is closed to new replies.

## Tags

 * [?cat](https://wordpress.org/support/topic-tag/cat/)
 * [loop](https://wordpress.org/support/topic-tag/loop/)
 * [loops](https://wordpress.org/support/topic-tag/loops/)
 * [tag](https://wordpress.org/support/topic-tag/tag/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [feefergross](https://wordpress.org/support/users/feefergross/)
 * Last activity: [17 years, 10 months ago](https://wordpress.org/support/topic/loop-problems-1/#post-835386)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
