Title: Parse error
Last modified: August 30, 2016

---

# Parse error

 *  [fiorelisa](https://wordpress.org/support/users/fiorelisa/)
 * (@fiorelisa)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/parse-error-341/)
 * After installing this theme, I’ve seen a blank page with this error message:
   ——————
   Parse error: syntax error, unexpected ‘[‘, expecting ‘,’ or ‘;’ in /membri/newblogprova/
   wp-content/themes/sg-window/inc/widget-functions.php on line 102 —————— It didn’t
   allowed me to access the Dashboard and change theme…. So I had to change the 
   php file myself. Please, check and fix the error.

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

 *  Theme Author [cats_456](https://wordpress.org/support/users/cats_456/)
 * (@cats_456)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/parse-error-341/#post-6273433)
 * fiorelisa, thank you for the info. I guess this parse error appears in older 
   php versions (below 5.3). Will change it and update.
 *  [stateofappiness](https://wordpress.org/support/users/stateofappiness/)
 * (@stateofappiness)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/parse-error-341/#post-6273632)
 * What was the fix?
 *  Theme Author [cats_456](https://wordpress.org/support/users/cats_456/)
 * (@cats_456)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/parse-error-341/#post-6273636)
 * Changed (line 101-103)
 *     ```
       else : ?>
          <img style="max-width:100%;" class="<?php echo esc_attr ( $object->get_field_id( $name ) ) . '_url'; ?>" src="<?php echo wp_get_attachment_image_src( $instance[ $name] )[0]; ?>" />
          <?php
       endif;
       ```
   
 * to
 *     ```
       else :
          $img = wp_get_attachment_image_src( $instance[ $name] );
          if ( $img ) :
          ?>
             <img style="max-width:100%;" class="<?php echo $object->get_field_id( $name ) . '_url'; ?>" src="<?php echo esc_attr( $img[0] ); ?>" />
          <?php
          else :
          ?>
             <img class="<?php echo $object->get_field_id( $name ) . '_url'; ?>" src="" />
          <?php
          endif;
       endif;
       ```
   
 *  [viktoriavet](https://wordpress.org/support/users/viktoriavet/)
 * (@viktoriavet)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/parse-error-341/#post-6273648)
 * Спасибо за помощь cats_456.
 * После изменения указанного кода появляется новая ошибка: 231. Для этого в этот
   же файл в строчку 231 добавить скобку: }
    После этого тема отлично работает!
 * After changing the code, said there is a new error: 231. To this end, the same
   file in line 231 to add brackets}
    After that, the theme works perfectly!

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

The topic ‘Parse error’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/sg-window/1.2.3/screenshot.png)
 * SG Window
 * [Support Threads](https://wordpress.org/support/theme/sg-window/)
 * [Active Topics](https://wordpress.org/support/theme/sg-window/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/sg-window/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/sg-window/reviews/)

 * 4 replies
 * 4 participants
 * Last reply from: [viktoriavet](https://wordpress.org/support/users/viktoriavet/)
 * Last activity: [10 years, 10 months ago](https://wordpress.org/support/topic/parse-error-341/#post-6273648)
 * Status: not resolved