Trying to access array offset on value of type bool – PHP version 8.1.15
-
Hi,
I’ve upgraded to PHP 8.1.15 and I got some errors on my site.
My site tellss me to:
– Warning: Trying to access array offset on value of type bool in?/home/ktsjing/domains/k-tsjing.be/public_html/beta2/wp-content/themes/angio/partials/loop.php?on line?75
– warning: Trying to access array offset on value of type bool in?/home/ktsjing/domains/k-tsjing.be/public_html/beta2/wp-content/themes/angio/partials/loop.php?on line?77
Dates
This the code I have in my wordpress file loop.php//////////////// // BACKGROUND // //////////////// if ( ! empty( get_post_meta( get_the_ID(), '_image_vertical_bg', true ) ) ) { $image_bg = get_post_meta( get_the_ID(), '_image_vertical_bg', true ); $image_id = $image_bg; $img_src_full = wp_get_attachment_image_src( $image_id, 'full' ); $img_src_full = $img_src_full[0]; $img_src_large = wp_get_attachment_image_src( $image_id, 'large' ); $img_src_large = $img_src_large[0]; $bg_style = get_post_meta( get_the_ID(), '_vertical_bg_style', true ); $bg_style = (!empty($bg_style)) ? $bg_style : 'fixed'; } else { $image_bg = false; $img_src_full = false; $img_src_large = false; $bg_style = 'none'; }
75 is = $img_src_full = $img_src_full[0];
77 = $img_src_large = $img_src_large[0];
I hope someone can help me out, thanks in advance!
Greetings,
Kevin
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Trying to access array offset on value of type bool – PHP version 8.1.15’ is closed to new replies.