1

I am on localhost and trying to create a new site. I have the Avada theme with demo content. At the bottom of the page of the demo there are social links. This message is there: Warning: Illegal string offset 'color_type' in C:\xampp\htdocs\pappas\wordpress\wp-content\themes\Avada\includes\widget\class-fusion-widget-social-links.php on line (multiple)

I am not smooth with PHP and could use some help. Below is the code that appears in that mentioned file.

if ( ! isset( $instance['tooltip_pos'] ) || '' == $instance['tooltip_pos'] )     {
        $instance['tooltip_pos'] = 'top';
    }

    if ( ! isset( $instance['icon_color'] ) || '' == $instance['icon_color']  ) {
        $instance['icon_color'] = '#bebdbd';
    }

    if ( ! isset( $instance['boxed_icon'] ) || '' == $instance['boxed_icon'] ) {
        $instance['boxed_icon'] = 'Yes';
    }

    if ( ! isset( $instance['boxed_color'] ) || '' ==        $instance['boxed_color'] ) {
        $instance['boxed_color'] = '#e8e8e8';
    }

    if ( ! isset( $instance['boxed_icon_radius'] ) || '' == $instance['boxed_icon_radius'] ) {
        $instance['boxed_icon_radius'] = '4px';
    }

    if ( ! isset( $instance['linktarget'] ) || '' == $instance['linktarget'] ) {
        $instance['linktarget'] = '_self';
    }

    if ( ! isset( $instance['color_type'] ) || '' == $instance['color_type'] ) {
        $instance['color_type'] = 'custom';
    }

    if ( isset( $instance['boxed_icon'] ) && isset(  $instance['boxed_icon_radius'] ) && 'Yes' == $instance['boxed_icon'] && ( $instance['boxed_icon_radius'] || '0' === $instance['boxed_icon_radius'] ) ) {
        $instance['boxed_icon_radius'] = ( 'round' == $instance['boxed_icon_radius'] ) ? '50%' : $instance['boxed_icon_radius'];
        $style .= 'border-radius:' . $instance['boxed_icon_radius'] . ';';
    }

    if ( isset( $instance['boxed_icon'] )  && 'Yes' == $instance['boxed_icon'] && isset( $instance['boxed_icon_padding'] )  && isset( $instance['boxed_icon_padding'] ) ) {
        $style .= 'padding:' . $instance['boxed_icon_padding'] . ';';
    }

    if ( isset( $instance['boxed_icon'] ) && 'Yes' == $instance['boxed_icon'] ) {
        $add_class .= ' boxed-icons';
    }

    if ( ! isset( $instance['icons_font_size'] ) || '' == $instance['icons_font_size'] ) {
        $instance['icons_font_size'] = '16px';
    }

    $style .= 'font-size:' . $instance['icons_font_size'] . ';';

    $social_networks = array();
    foreach ( $instance as $name => $value ) {

Any help would be appreciated. Thank you.

As I am not very seasoned in coding, please feel free to dumb down the advice!

  • 1
    It is warning you that the code is trying to check a value in an array that doesn't exist. It is only a warning which you can turn off for production. To fix it the code needs to be changed to check if the value exists before it tries to use it. The same would apply to any of those other values if they don't exist either – Andy Feb 03 '17 at 16:17

0 Answers0