Title: Parse error: syntax error, unexpected T_ELSE
Last modified: August 19, 2016

---

# Parse error: syntax error, unexpected T_ELSE

 *  [nickelbert](https://wordpress.org/support/users/nickelbert/)
 * (@nickelbert)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_else/)
 * page.php
    —————————- <?php get_header(); ?> <div id=”content”>
 *  <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
 *  <div class=”post” id=”post-<?php the_ID(); ?>”>
    <h2><?php the_title(); ?></
   h2> <span class=”post-cat”><?php the_category(‘, ‘) ?></span> </div> <div class
   =”entry”> <?php the_content(‘<p class=”serif”>Read the rest of this page »</p
   >’); ?>
 *  <?php wp_link_pages(array(‘before’ => ‘<p>**Pages:** ‘, ‘after’ => ‘</p>’, ‘
   next_or_number’ => ‘number’)); ?>
    </div>
 *  <?php comments_template(); ?>
    </div>
 *  <?php endwhile; endif; ?>
 *  <div class=”navigation”>
    <span class=”previous-entries”><?php previous_post_link(‘%
   link’)?></span> <span class=”next-entries”><?php next_post_link(‘%link’)?></span
   > </div>
 *  <?php else : ?>
 *  <h2>Not Found</h2>
    <p>Sorry, but you are looking for something that isn’t here.
   </p>
 *  <?php endif; ?>
 *  </div>
    <!–/content –>
 * <?php get_sidebar(); ?>
    <?php get_footer(); ?>
 * It says I have an unexpected parse error of T_ELSE on line 26 which is
    <?php
   else : ?>
 * Any help would be great.

Viewing 1 replies (of 1 total)

 *  [Arnold Goodway](https://wordpress.org/support/users/arnoldgoodway/)
 * (@arnoldgoodway)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_else/#post-1265857)
 * Just above the navigation class you have this:
 *     ```
       <?php endwhile; endif; ?>
       ```
   
 * You need to delete the last endif bit.

Viewing 1 replies (of 1 total)

The topic ‘Parse error: syntax error, unexpected T_ELSE’ is closed to new replies.

## Tags

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

 * 1 reply
 * 2 participants
 * Last reply from: [Arnold Goodway](https://wordpress.org/support/users/arnoldgoodway/)
 * Last activity: [16 years, 7 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_else/#post-1265857)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
