• 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

    (@cats_456)

    fiorelisa, thank you for the info. I guess this parse error appears in older php versions (below 5.3). Will change it and update.

    What was the fix?

    Theme Author cats_456

    (@cats_456)

    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;

    Спасибо за помощь 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.