What do I need to change, Please I receive this a number of times

Notice: Undefined index: image_title in /home/wwwcane/public_html/tiny/wp-content/themes/beaver/header.php on line 131

foreach( $slAr as $sv ){

  $n++; ?><img src="<?php echo esc_url($sv['image_src']); ?>" alt="<?php echo esc_attr($sv['image_title']);?>" title="<?php echo /* line #131 */
  '#sl.lidecaption'.$n ; ?>"/><?php

  $slideno[] = $n;

  • Can you please write header.php code so i can check it and give you solution. – Milan Hirpara Jun 17 '19 at 4:47
  • 1
    The notice is saying that the image_src item doesn't exist in the array. You can do var_dump( $sv ); to see the items in the $sv array. And to avoid the notice, you could do if ( isset( $sv['image_src'] ) ) { ... }. Or update whatever the resource is and be sure to use proper values. – Sally CJ Jun 17 '19 at 5:23

Your Answer

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

Browse other questions tagged or ask your own question.