WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] PHP Warning: Illegal string offset (6 posts)

  1. largado
    Member
    Posted 4 months ago #

    I installed a wordpress theme and I got this warning:

    Warning: Illegal string offset 'name' in C:\XAMPP\htdocs\wp2\wp-content\themes\lexiity\inc\theme-settings.php on line 12

    This is line 12:

    if(@$r3['value'] != '' && strlen($r3['name']) != 1 && $r3['type'] != 'select' && $r3['type'] != 'radio' && $r3['type'] != 'checkbox'){

    This is the entire function:

    function populate_theme_options(){ GLOBAL $tabs,$wp_version; $pages = @get_all_pages(); foreach ($tabs as $r1) { foreach ($r1 as $r2) { if (count($r2) > 0) { foreach ((array)$r2 as $r3) { if(@$r3['value'] != '' && strlen($r3['name']) != 1 && $r3['type'] != 'select' && $r3['type'] != 'radio' && $r3['type'] != 'checkbox'){ if ( version_compare( $wp_version, '3.4', '>=' ) ) {update_option(wp_get_theme().'_'.$r1['id'].'_'.$r3['name'], $r3['value']);}else{update_option(get_current_theme().'_'.$r1['id'].'_'.$r3['name'], $r3['value']);} } } } } } }

    Here is all the code in this php file:

    http://pastebin.com/6KdYVtXF

    How to remove this warning?

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 4 months ago #

    There does not appear to be a theme named "lexiity" in the WordPress.org themes directory.

    If this is a commercial theme, you really need to go ask for help from the theme's author or vendor directly. They are best equipped to fix the problems with the theme's code.

  3. largado
    Member
    Posted 4 months ago #

    Hello. I've tried, they do not respond. This is a free theme.

  4. stephencottontail
    Member
    Posted 4 months ago #

    But it doesn't come from the official WP.org repository. Here, we only support themes that were downloaded from the official WP.org repository.

  5. Samuel Wood (Otto)
    Tech Ninja
    Posted 4 months ago #

    That said, if you're getting warning messages on your live site, then you need to turn off the PHP display_errors setting. Production sites should never have debugging mode enabled.

  6. largado
    Member
    Posted 4 months ago #

    Ok. Thanks

Reply

You must log in to post.

About this Topic