wordpress – Notice: Undefined Index and Cannot modify header

It occurs when WP_DEBUG is enabled:

The WP_DEBUG option, added in WordPress, controls the reporting of some errors and warnings and enables use of the WP_DEBUG_DISPLAY and WP_DEBUG_LOG settings. The default value is false.

NOTE: The true and false values in the example are not set in apostrophes (‘) because they are boolean values.
define( ‘WP_DEBUG’, true );
define( ‘WP_DEBUG’, false );
Additionally, if you are planning on modifying some of WordPress’ built-in JavaScript or Cascading Style Sheets, you should add the following code to your config file:

define( ‘SCRIPT_DEBUG’, true );
Then the uncompressed versions of scripts and stylesheets in wp-includes/js, wp-includes/css, wp-admin/js, and wp-admin/css will be loaded instead of the .min.css and .min.js versions.

Leave a Reply

Your email address will not be published. Required fields are marked *