Aroganz
Aroganz

Reputation: 114

Notice: Undefined index: on WooCommerce Loop

Getting the following error on a woocommerce shop:

Notice: Undefined index: columns in /hermes/bosweb26a/b1953/ipw.felix1968/public_html/wp-content/themes/charmaynemakeup/woocommerce/loop/loop-start.php on line 12

I searched around and found isset is the way forward. Kindly can someone point me how to address this.

Upvotes: 0

Views: 2332

Answers (1)

keyBeatz
keyBeatz

Reputation: 139

Notice is not an error. You can turn it off in wp-config.php with

define( 'WP_DEBUG', false );

However that will not repair your code (you should have debug false on production anyways). Undefined index means that you are trying to access index of array which is not available. Before running that line of code, ask if is set.

if( isset( $array( 'column' ) ) )
    echo $array( 'column' );

Upvotes: 2

Related Questions