Error “Undefined array key 1” in wp-includes/media.php:71
-
We have errors on our website
Undefined array key 0
wp-includes/media.php:779
5 Plugin: _schema-and-structured-data-for-wp
Warning Undefined array key 0
wp-includes/media.php:785
4 Plugin: _schema-and-structured-data-for-wp
Warning Undefined array key 1
wp-includes/media.php:785
4 Plugin: _schema-and-structured-data-for-wp
Warning Undefined array key 0
wp-includes/media.php:787
4 Plugin: _schema-and-structured-data-for-wp
Warning Undefined array key 1
wp-includes/media.php:787
4 Plugin: _schema-and-structured-data-for-wp
Warning Undefined array key 0
wp-includes/media.php:790
4 Plugin: _schema-and-structured-data-for-wp
Warning Undefined array key 1
wp-includes/media.php:790
4 Plugin: _schema-and-structured-data-for-wp
Warning Undefined array key 1
wp-includes/media.php:779
1 Plugin: _schema-and-structured-data-for-wp
Warning Undefined array key 0
wp-includes/media.php:70
2 Plugin: _schema-and-structured-data-for-wp
Warning Undefined array key 1
wp-includes/media.php:71
We have a custom theme on the site. But even when we switch to the Twenty Twenty-One theme and upload the logo, there are still errors.
I looked at your plugin code and found that errors are caused by this code:
“$sizes = array(
‘width’ => 600,
‘height’ => 60,
‘crop’ => false,
);
$custom_logo_id = get_theme_mod( ‘custom_logo’ );
if($custom_logo_id){
$custom_logo = @wp_get_attachment_image_src( $custom_logo_id, $sizes);
}”
Now I commented out the line where you add a custom size for the logo and the error is gone. Could you please fix this in the plugin.
The topic ‘Error “Undefined array key 1” in wp-includes/media.php:71’ is closed to new replies.