Hi @cfm168,
Thanks for sharing the error details. I had a closer look at the stack trace, and here’s what’s happening:
The error is coming from WordPress core’s media.php, but the root cause is how your theme is calling the wp_get_attachment_image() function. In your trace, it’s being passed an array instead of a string for the image size, which causes the “Cannot access offset of type string on string” error.
Specifically, this part stands out:
wp_get_attachment_image(456, Array)
/wp-content/themes/twentyeleven/image.php:105
The second parameter should be a string like ‘thumbnail’, ‘medium’, or ‘full’, not an array. This points to an issue in your theme template file (image.php in the Twenty Eleven theme).
Since this isn’t coming from WooCommerce itself, the best next step would be to:
- Check if you’re using a child theme or a modified copy of Twenty Eleven. If so, update or correct the template override so it passes a valid size string to
wp_get_attachment_image().
- If it’s the original Twenty Eleven theme, it may be worth switching to a more recent theme, as Twenty Eleven is quite old and not actively updated for modern PHP versions.
- In the meantime, WooCommerce itself is still functioning (as you noted, orders are going through), but certain image templates will continue to throw errors until the theme code is corrected.
- Once you switch to a new themee, go to WooCommerce → Status → Tools and run “Regenerate store thumbnails”.
- The error mentions image ID 456. You could try checking that specific image in your Media Library and see if it’s corrupted.
Let me know how it goes. Looking forward to your response.
Thread Starter
cfm168
(@cfm168)
@frankremmy, Thank you for your advising.
Checked from Media/Library, the image ID 456 looks (displaying) good there.
Uploaded on: July 29, 2012
Uploaded by: M
File name: hided148.png
File type: image/png
File size: 18 KB
Dimensions: 148 by 97 pixels
I want to keep with this theme because the site structure fit my contents arrangement and have some ccs modified. Change to a new theme will cause a lot of works.
Hope you can help further. Thanks in advance!
Hi @cfm168,
Thank you for getting back to us and for the clarification. I completely understand how frustrating issues like this can be, especially when it’s difficult to find the right support.
Unfortunately, this isn’t something we can resolve directly in this forum, as it’s related to your theme and WordPress rather than WooCommerce core. I can see you’ve already tried seeking help here: https://ww.wp.xz.cn/support/topic/fatal-error-uncaught-typeerror-media-php800/ but haven’t received a response yet.
At this point, it might be worth considering updating your website design by switching to a different theme, or reaching out to external developers through platforms like Codeable.io who can help provide a fix, even if it’s just a temporary workaround.
I truly wish I could assist further, but as this forum is dedicated to WooCommerce core issues, your request unfortunately falls outside the scope of support we can offer here.
Thread Starter
cfm168
(@cfm168)
Accidently found that, disabling MailPoet plugin the error disappeared. This is the third day no more errors occur. Let’s test/wait more days.
Hi there!
Thanks for the update! Glad to hear disabling the MailPoet plugin seems to have resolved the issue
If WooCommerce has been helpful in building your store, we’d be super grateful if you could take a moment to leave us a ⭐⭐⭐⭐⭐ review here: https://ww.wp.xz.cn/support/plugin/woocommerce/reviews/#new-post. Your feedback really helps us improve and also supports other store owners.
As we haven’t heard from you in some time, I’ll be closing this case as resolved. Don’t hesitate to get back to us whenever you’re ready.
Thread Starter
cfm168
(@cfm168)
Confirmed disabling Mailpoet resolved the issues.
Hi @cfm168,
I appreciate the confirmation that disabling MailPoet resolved the issue, it’s great to hear everything is now running smoothly. Since you’ve been using WooCommerce for your store and have also received support along the way, we’d truly appreciate it if you could take a moment to leave us a quick 5-star review here: https://ww.wp.xz.cn/support/plugin/woocommerce/reviews/#new-post. Your feedback goes a long way in helping us improve and supporting other store owners.
Feel free to open a new forum topic if you run into any other problem.