Title: &quot;Parse error: syntax error, unexpected T_ENDWHILE&quot;
Last modified: August 21, 2016

---

# "Parse error: syntax error, unexpected T_ENDWHILE"

 *  Resolved [breathelifein](https://wordpress.org/support/users/biellebrunner/)
 * (@biellebrunner)
 * [13 years ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_endwhile-9/)
 * I was updating some pages on my website, and when I tried to see if all was well,
   I got this error message:
 * Parse error: syntax error, unexpected T_ENDWHILE in /home/…/page.php on line 
   22
    This is page.php
 *     ```
       <?php get_header(); ?>
   
       <p align="center">
       	<span class="title">
       		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
       		<id="post-<?php the_ID(); ?>"><?php the_title(); ?>
       	</span>
   
       	<div class="news">
       		<?php the_content('Leia o restante da página &raquo;'); ?>
       		<?php link_pages('<p><strong>Páginas:</strong> ', '</p>', 'número'); ?>
   
       		<?php endwhile; endif; ?>
   
       		<h4><center><a href="javascript:history.go(-1)">&laquo;&laquo; Voltar</a> | <a href="#">Topo</a> <?php edit_post_link('(editar)'); ?></center></h4>
   
       	</div>
       </p>
   
       <?php comments_template(); ?>
   
       <?php endwhile; else: ?>
       <p><?php _e('Lamento, página não encontrada.'); ?></p>
       <?php endif; ?>
   
       <?php get_footer(); ?>
       ```
   
 * Line 22 is `<?php endwhile; else: ?>`
 * It was working fine until recently, and I haven’t touched these php files in 
   ages, so I have no clue as to why this happened now. Does anyone have an idea
   of what’s wrong?
    Thanks.

Viewing 1 replies (of 1 total)

 *  Thread Starter [breathelifein](https://wordpress.org/support/users/biellebrunner/)
 * (@biellebrunner)
 * [13 years ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_endwhile-9/#post-3752804)
 * Resolved.

Viewing 1 replies (of 1 total)

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

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [breathelifein](https://wordpress.org/support/users/biellebrunner/)
 * Last activity: [13 years ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_endwhile-9/#post-3752804)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
