Could really use some code help concerning Wordpress Please

3 replies
  • WEB DESIGN
  • |
Hey guys, so check this out, when I create a published post, I get these errors,


Code:
Warning: Illegal string offset 'year' in /home/agent/public_html/wp-content/themes/car-dealer-v1_5_2/single-gtcd.php on line 24

Warning: Illegal string offset 'make' in /home/agent/public_html/wp-content/themes/car-dealer-v1_5_2/single-gtcd.php on line 25

Warning: Illegal string offset 'model' in /home/agent/public_html/wp-content/themes/car-dealer-v1_5_2/single-gtcd.php on line 26

Warning: Illegal string offset 'miles' in /home/agent/public_html/wp-content/themes/car-dealer-v1_5_2/single-gtcd.php on line 27

Warning: Illegal string offset 'vin' in /home/agent/public_html/wp-content/themes/car-dealer-v1_5_2/single-gtcd.php on line 28

Warning: Illegal string offset 'stock' in /home/agent/public_html/wp-content/themes/car-dealer-v1_5_2/single-gtcd.php on line 30

Warning: Illegal string offset 'miles' in /home/agent/public_html/wp-content/themes/car-dealer-v1_5_2/single-gtcd.php on line 31
Looks bad right? But check this out, when I go back to the post and simply click the UPDATE button, it all goes away and the post looks fine. Any ideas what would cause this?

The code that is triggering the Offset is
#code #wordpress
  • Profile picture of the author David V
    Did you recently upgrade your PHP version? (or the hosting company)
    What version are your running on your hosting?
    Has the site been ok,then just started this error, or has been that way all along?

    One possibility (among many) is a parameter $something is expected to be an array.
    The passed function might be a string when it should be an array.
    Whether an error is kicked by this depends on the PHP version.

    Probably need to see more.... hard to tell just from that.

    Is this the Openhouse/Automotiv theme from Themeforest by chance?
    {{ DiscussionBoard.errors[8025960].message }}
  • Profile picture of the author KingRoyal
    No this theme we have is totally custom and no upgrades or anything, I get the errors only when importing posts, and once I update them, the errors go away. It's really. really strange.
    {{ DiscussionBoard.errors[8025963].message }}
  • Profile picture of the author clickbump
    Check your wp-config.php for this line:

    Code:
    define('WP_DEBUG', true);
    If its set to "true" as in the above code snippet, change it to "false" and save the file.

    You may also want to have a PHP coder look into our error to resolve it. Looks like a simple fix.
    Signature
    {{ DiscussionBoard.errors[8030036].message }}

Trending Topics