0

So, my WordPress site (which I did not set up) has suddenly taken to throwing errors whenever I go to the admin page. The error message says:

Warning: Creating default object from empty value in /home3/nohighs1/public_html/wp-content/themes/StandardTheme_272/admin/functions.php on line 229

Warning: Cannot modify header information - headers already sent by (output started at /home3/nohighs1/public_html/wp-content/themes/StandardTheme_272/admin/functions.php:229) in /home3/nohighs1/public_html/wp-includes/pluggable.php on line 1121

The site itself works fine.

I am a developer, but my knowledge of PHP and WordPress is almost nil. I also don't know if I have FTP access to get to the files, although I can probably obtain it if required.

I realise this is almost nothing to go on, but if anyone does know anything about how to fix this, I'd appreciate the help. I'm also terribly curious about how this happened - no-one changed anything on the back end, it just suddenly started throwing this error.

  • Try disabling plugins one at a time. Maybe one of theme is causing this error. – jgraup Nov 29 '15 at 20:44
  • 2
    The first warning being displayed causes the second warning, ignore the second warning and focus on the first. You will need the files to be able to fix the problem, otherwise the warning is straightforward, you tried to use a variable which didn't have a value ( an empty value ), so PHP created one for you ( Creating default object ), and generated a warning to let you know. Your server however is configured to display warnings on the frontend rather than in a PHP error log. This means the server has to send HTTP headers to start displaying output. Hence Warning number 2 – Tom J Nowell Nov 29 '15 at 22:36
2

That's a PHP warning, not technically an error, and isn't real critical.

It's due to your webhost updating the version of PHP; and the theme StandardTheme_272 should initialize an object before setting a property.

See if there is a theme update. If not, https://stackoverflow.com/questions/14806959/how-to-fix-creating-default-object-from-empty-value-warning-in-php for instructions on how to fix the theme.

You can temporarily suppress the warning being dumped to html by checking to see of wp_debug has been enabled in wp-config.php and disable it; see https://codex.wordpress.org/WP_DEBUG

Or, try adding this ini_set to your wp-config.php

ini_set( 'display_errors', 0 );

to suppress the warning.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.