Title: Parse error on comments.php: unexpected T_ENDFOREACH
Last modified: August 18, 2016

---

# Parse error on comments.php: unexpected T_ENDFOREACH

 *  [elyonline](https://wordpress.org/support/users/elyonline/)
 * (@elyonline)
 * [21 years ago](https://wordpress.org/support/topic/parse-error-on-commentsphp-unexpected-t_endforeach/)
 * Hi there,
 * I am getting the error below on my comments form:
 * Parse error: parse error, unexpected T_ENDFOREACH in /home/public_html/news/wp-
   content/themes/elyonline/comments.php on line 28
 * I can’t see any errors but I am sure someone will point out my error 🙂
 * Here is a link to a text file of my comments page:
    [http://www.elyonline.co.uk/comments.txt](http://www.elyonline.co.uk/comments.txt)
 * Many thanks

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

 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [21 years ago](https://wordpress.org/support/topic/parse-error-on-commentsphp-unexpected-t_endforeach/#post-195695)
 * I’ve checked several comments.php files in different themes, and all of them 
   have this line:
    `<?php foreach ($comments as $comment) : ?>` Yours has it like
   this: `<?php foreach ($comments as $comment) { ?>` I’m not a coder, but I’d give
   it a try…
 *  [ColdForged](https://wordpress.org/support/users/coldforged/)
 * (@coldforged)
 * [21 years ago](https://wordpress.org/support/topic/parse-error-on-commentsphp-unexpected-t_endforeach/#post-195696)
 * Moshu called it.
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [21 years ago](https://wordpress.org/support/topic/parse-error-on-commentsphp-unexpected-t_endforeach/#post-195699)
 * 🙂 actually I have no idea what the difference is… I just put my +2.5 glasses
   on, LOL
 *  Thread Starter [elyonline](https://wordpress.org/support/users/elyonline/)
 * (@elyonline)
 * [21 years ago](https://wordpress.org/support/topic/parse-error-on-commentsphp-unexpected-t_endforeach/#post-195716)
 * Ha good stuff 🙂
 * Very good eyesight indeed 🙂
 * Thanks a lot
 *  Thread Starter [elyonline](https://wordpress.org/support/users/elyonline/)
 * (@elyonline)
 * [21 years ago](https://wordpress.org/support/topic/parse-error-on-commentsphp-unexpected-t_endforeach/#post-195878)
 * ** fixed** thanks

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

The topic ‘Parse error on comments.php: unexpected T_ENDFOREACH’ is closed to new
replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 3 participants
 * Last reply from: [elyonline](https://wordpress.org/support/users/elyonline/)
 * Last activity: [21 years ago](https://wordpress.org/support/topic/parse-error-on-commentsphp-unexpected-t_endforeach/#post-195878)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
