Title: PHP Parse error:  syntax error, unexpected &#039;echo&#039; (T_ECHO) in single.php
Last modified: August 31, 2016

---

# PHP Parse error: syntax error, unexpected 'echo' (T_ECHO) in single.php

 *  [ariapictures](https://wordpress.org/support/users/ariapictures/)
 * (@ariapictures)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/php-parse-error-syntax-error-unexpected-echo-t_echo-in-singlephp/)
 * Looking all over and no real clear answer or solution to this error i am seeing
   in my error_log.
 * PHP Parse error: syntax error, unexpected ‘echo’ (T_ECHO) in single.php on line
   15.
 * I am using Advanced Custom Field Plug in, all other pages work, but I cannot 
   find out why it is giving me the (T_ECHO) error.
 *     ```
       <?php 
   
        get_header(); 
   
        $format = get_post_format();
       ?>
   
       <!-- single.php - 03312016-gmd -->
       <!--
        == == == == == == == == == == == == ==
        ==    B: ** HERO IMAGE DISPLAY **   ==
        == == == == == == == == == == == == ==
       -->
   
       (line 15 ==>) <div style="display:<?php the_field('display_hero_image');?>;" class="product-hero-image"><img src="<?php the_field('hero_image'); ?>" alt="<?php the_field('hero_image_description'); ?>" title="<?php the_field('hero_image_description'); ?>"></div>
       <div class="wrapper section no-padding">
        <?php get_sidebar(); ?>
        <div class="section-inner">
         <div class="content fleft">
   
          <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
   
           <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
   
            <?php if ($format == 'quote' || $format == 'link' || $format == 'audio' || $format == 'status' || $format == 'chat') : ?>
   
            <?php if ( has_post_thumbnail() ) : ?>
   
             <div class="featured-media">
   
              <?php the_post_thumbnail('post-image'); ?>
   
              <?php if ( !empty(get_post(get_post_thumbnail_id())->post_excerpt) ) : ?>
   
               <div class="media-caption-container">
   
                <p class="media-caption"><?php echo get_post(get_post_thumbnail_id())->post_excerpt; ?></p>
               </div>
   
              <?php endif; ?>
   
             </div> <!-- // .featured-media -->
   
            <?php endif; ?>
   
           <?php endif; ?>
   
           <div class="post-header">
       ```
   

Viewing 1 replies (of 1 total)

 *  Thread Starter [ariapictures](https://wordpress.org/support/users/ariapictures/)
 * (@ariapictures)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/php-parse-error-syntax-error-unexpected-echo-t_echo-in-singlephp/#post-7317367)
 * This code, line 15 does work on other template pages. so I know it is really 
   saying that a line before or afterward has a problem. but I do not see it.
 * does not mean it is not there…

Viewing 1 replies (of 1 total)

The topic ‘PHP Parse error: syntax error, unexpected 'echo' (T_ECHO) in single.php’
is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [ariapictures](https://wordpress.org/support/users/ariapictures/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/php-parse-error-syntax-error-unexpected-echo-t_echo-in-singlephp/#post-7317367)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
