Hello,
I use SiteOrigin Page Builder + SiteOrigin Widgets Bundle on my website and I have a problem when I use the widget SiteOrigin Image : the image doesn’t appear on the front end.
The generated HTML code is the following :
<img title="page_title" alt="" loading="lazy" class="so-widget-image">
As you can see, there’s no src attribute.
After search, the line 115 from the file “siteorigin-panels/inc/widget-shortcode.php” is the problem.
$data = json_decode( html_entity_decode( $matches[1], ENT_QUOTES ), true );
the json_decode function return false because there are not escaped quotes in html_entity_decode.
{"instance":{"image":13104,"image_fallback":"","size":"large","size_width":"","size_height":"","align":"default","title_align":"default","title":"","title_position":"hidden","alt":"","url":"","_sow_form_id":"123318338861406b96923e4118523029","_sow_form_timestamp":"1631612374271","link_title":false,"new_window":false,"bound":false,"full_width":false,"so_sidebar_emulator_id":"sow-image-1310310003","option_name":"widget_sow-image"},"args":{"before_widget":"<div id="panel-13103-0-0-3" class="so-panel widget widget_sow-image panel-last-child" data-index="3" data-style="{"background_image_attachment":false,"background_display":"tile"}" >","after_widget":"</div>","before_title":"<h3 class="widget-title">","after_title":"</h3>","widget_id":"widget-0-0-3"}}
when I remove the quotes in “{“background_image_attachment”:false,”background_display”:”tile”}”, the image appears.
How can I solve my problem ?
Hi
Thanks for reaching out.
When able, please, try checking for a working baseline:
* Clear any caching or optimization plugins.
* Temporarily deactivate all plugins except for Page Builder and the Widgets Bundle.
* In this state, does the issue resolve?
Hi,
Thank you for your reply.
In my dev environment, I got no caching or optimization plugin
I disabled every plugins except ACF Pro and Timber (they are required for the site)
After save the page again, the issue doesn’t resolve
Thanks for the update. By default, the issue shouldn’t be occurring. I haven’t come across an issue of this nature in the past. If you have a moment, please, try checking further for a working baseline:
* Temporarily switch to a default theme like Twenty Nineteen.
* Temporarily deactivate all plugins except for the Widgets Bundle and Page Builder.
* Test existing SiteOrigin Image Widgets. Test adding a new SiteOrigin Image Widget.
For the above test, please, deactivate all plugins except for Page Builder and Widgets Bundle. Even required plugins. We’re just doing a quick check to see if a working baseline is available. The test shouldn’t take more than a couple of minutes.
Ok, after test on new theme, it works.
Issue comes from my theme so, (and I realize it’s only for a custom post type).
Thanks for your replies.
Thanks for testing further. I’m glad to hear you’re making progress. Hopefully, you can find the reason the widget isn’t behaving normally in the post type.
Hi,
I finally solve my problem… I searched too deep.
I use Timber on my site and the display code for my content was
On my other Post Type, it was
so I replace the first line by the second and it works.
Thanks for your spending time
Super. Really glad to hear you’ve made progress. Thanks for keeping us updated and posting your fix.
Cheers for now.