Title: getting parse error &#8211; 1st time theme
Last modified: August 19, 2016

---

# getting parse error – 1st time theme

 *  Resolved [hanzzsolo](https://wordpress.org/support/users/hanzzsolo/)
 * (@hanzzsolo)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/getting-parse-error/)
 * Help I am getting a Parse error on this code. what am I doing wrong?
    ERROR is**
   BOLD**
 * <body>
 * <div id=”header”>
 * </h1>
    <?php bloginfo(‘description’);?>
 * </div>
 * <div id=”container”>
 *  <?php if(have_posts()):?><?php while(have_posts()):the_post();?>
    <?php the_title();?
   > after the_post(); ?> and before <?php endwhile; ?> **<?php endwhile;?>** **
   ERROR ON THIS LINE** <?php endif;?>
 * </div>
 * </body>

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

 *  [Frumph](https://wordpress.org/support/users/frumph/)
 * (@frumph)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/getting-parse-error/#post-1172196)
 * look at it in a more ..easier to read way.
 *     ```
       if (have_posts(): 
   
         while (have_posts()):
   
           the_title(); "after the_posts(); ?> and before "
   
         endwhile;
       endwhile;
       endif;
       ```
   
 * What you have here is actually 2 errors.
 * 1) You do not have a <?php before the_post(); ?> so it’s going to echo out after
   the_post(); to your screen. I’m guessing your just trying to output the second
   the_post(); as a string.
 * 2) You have 2 endwhiles; with only 1 loop.
 *     ```
       <div id="container">
       <?php
            if (have_posts()) :
               while (have_posts()) : the_post(); ?>
                  <?php the_title(); ?> after the_post(); <br />
               <?php endwhile;
            endif;
       ?>
       </div>
       ```
   
 * Anytime you start <?php your telling the parser to execute whatever’s inside 
   as php so when you placed that there it’s actually thinking to use that first
   endwhile, as the endwhile so the second endwhile shows up and is’nt needed.
 * If you want to use < and >’s as text on your screen use &lt ; and &gt ; respectively.
 *  Thread Starter [hanzzsolo](https://wordpress.org/support/users/hanzzsolo/)
 * (@hanzzsolo)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/getting-parse-error/#post-1172220)
 * Thanks for the help. Now I am getting when I view the page (this is a fresh install
   of WP also)
 * Hello world! after the_post(); ?>
 * the tutorial I am using says it should be looping. the link is included: [http://www.wpdesigner.com/2007/02/25/wp-theme-lesson-5-the-loop/](http://www.wpdesigner.com/2007/02/25/wp-theme-lesson-5-the-loop/)

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

The topic ‘getting parse error – 1st time theme’ is closed to new replies.

## Tags

 * [parse-error](https://wordpress.org/support/topic-tag/parse-error/)

 * 2 replies
 * 2 participants
 * Last reply from: [hanzzsolo](https://wordpress.org/support/users/hanzzsolo/)
 * Last activity: [16 years, 10 months ago](https://wordpress.org/support/topic/getting-parse-error/#post-1172220)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
