Home › Forums › WoodMart support forum › file_get_contents error
file_get_contents error
- This topic has 5 replies, 2 voices, and was last updated 8 months ago by Artem Temos.
-
AuthorPosts
-
March 22, 2024 at 2:28 pm #551449
smart.sharukhkhan786ParticipantHi,
I’ve encountered an issue with displaying SVG files on my website that I can’t seem to resolve. Initially, SVGs were working perfectly. However, after updating my header menu under Appearance > Menu, SVG files began to show errors, specifically: “file_get_contents(https://www.craple.in/wp-content/uploads/2023/10/retail-free-shipping.svg): Failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden at wp-content/plugins/woodmart-core/post-types.php:728.”
Here are the steps I’ve taken to troubleshoot the problem:
1. Contacted my hosting provider to ensure there were no issues on their end.
2. Consulted with my developer, who confirmed that there are no issues with displaying SVGs on the website in general. The problem seems to be isolated to certain pages. Direct access to the SVG URL (https://www.craple.in/wp-content/uploads/2023/10/retail-free-shipping.svg) shows no errors, indicating the file itself is accessible.
3. Attempted to restore a previous backup and reinstall the Panel, but this did not resolve the issue.
4. Disabling all plugins did not rectify the problem either.
This situation is quite frustrating, as I cannot pinpoint the cause of this error or find a way to fix it. It seems to be hit or miss. For instance, disabling object caching occasionally makes the SVGs appear again, but re-enabling it brings back the error. Oddly, repeating this process doesn’t always yield the same result. Similarly, disabling and re-enabling plugins one by one has sporadically resolved the error, only for it to reappear upon making changes to theme or menu settings.Could you advise on how I might permanently fix this error?
March 22, 2024 at 3:13 pm #551473
Artem TemosKeymasterHello,
Please, provide us with your admin access so we can log in and check this on your side.
Thank you in advance.
March 22, 2024 at 3:22 pm #551478
smart.sharukhkhan786ParticipantIn private
March 22, 2024 at 3:25 pm #551481
Artem TemosKeymasterHello,
Try to add the following PHP code snippet to the child theme functions.php file to fix this.
add_filter('woodmart_show_infobox_svg_by_tag', '__return_false');
Kind Regards
March 22, 2024 at 3:37 pm #551486
smart.sharukhkhan786ParticipantI can’t believe this, after spending so much time on this issue, was the solution just adding these codes?
March 25, 2024 at 10:22 am #551893
Artem TemosKeymasterYes, we will change the way SVG images are displayed in our next theme update to fix this issue.
-
AuthorPosts
Tagged: svg
- You must be logged in to create new topics. Login / Register