Title: WordPress Loop Doesn&#039;t Work
Last modified: August 19, 2016

---

# WordPress Loop Doesn't Work

 *  Resolved [zomb1equeen](https://wordpress.org/support/users/zomb1equeen/)
 * (@zomb1equeen)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/wordpress-loop-doesnt-work/)
 * im working on creating my first theme (using a video tutorial). I typed out everything
   the person said to do, yet my Loop doesnt work. When I put the code in, all that
   shows up on my site is the
 * > `<?php else : ?>`
 *  part, instead of my test posts.
 * Here is what I have. Can anyone help me out and tell me what I’m doing wrong??
   I really appreciate it! My site is [http://www.vegansutra.com](http://www.vegansutra.com),
   if you need to see the source for whatever reason
 * > `<!– BEGIN CONTENT –>
   >  <div id=”main”> <div id=”primary”>
   >  <?php if(have_posts()) : while(have_posts()) : the_post(); ?>
   >  <div class=”post-date”>
   >  <div class=”day”><?php the_time(‘d’)?></div> <div
   > class=”month”><?php the_time(‘M’)?></div> </div>
   >  <div class=”post-item”>
   >  <img src=”<?php echo bloginfo(‘template_directory’).‘/
   > images/pic-01.png’; ?>” alt=”post image” /> <h2><?php the_title(); ?></h2> 
   > <p class=”meta”>Category Parent | Child</p> <p> Lorem ipsum dolor sit amet,
   > sit diam ut sed jus consequat nunc incassum fatua, sed genitus, virtus, saepius
   > pagus. Autem bene ingenium aptent aliquam inhibeo, accumsan nonummy proprius
   > pneum reprobo letalis vindico duis elit. </p> <a href=”#” class=”more-link”
   > >Continue Reading »</a>
   >  </div> <!– end post-item –>
   >  <?php endwhile; ?>
   >  <?php else : ?>
   >  <p>I’m not sure what you’re looking for.</p> <?php endif;?
   > >
   >  <!– page-navigation –>
   >  <div class=”page-navigation”>
   >  <div class=”left”><a href=””><img src=”<?php echo bloginfo(‘template_directory’).‘/
   > images/nav/prevbutton.png’; ?>” border=”0″ /></a></div>
   >  <div class=”right”><a href=””><img src=”<?php echo bloginfo(‘template_directory’).‘/
   > images/nav/nextbutton.png’; ?>” border=”0″ /></a></div>
   >  </div>
   >  </div> <!–End of “primary”–>
   >  `

The topic ‘WordPress Loop Doesn't Work’ is closed to new replies.

## Tags

 * [Coding](https://wordpress.org/support/topic-tag/coding/)
 * [loop](https://wordpress.org/support/topic-tag/loop/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [zomb1equeen](https://wordpress.org/support/users/zomb1equeen/)
 * Last activity: [15 years, 9 months ago](https://wordpress.org/support/topic/wordpress-loop-doesnt-work/)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
