Home>Support>SiteOrigin_Widget_Image_Widget – Images not working – missing src

SiteOrigin_Widget_Image_Widget – Images not working – missing src

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 ?

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 1 year, 2 months ago Andrew Misplon Hi, I Work Here

    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?

  2. 1 year, 2 months ago Entities

    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

  3. 1 year, 2 months ago Andrew Misplon Hi, I Work Here

    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.

  4. 1 year, 2 months ago Entities

    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.

  5. 1 year, 2 months ago Andrew Misplon Hi, I Work Here

    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.

  6. 1 year, 2 months ago Entities

    Hi,

    I finally solve my problem… I searched too deep.

    I use Timber on my site and the display code for my content was

    {{ page.post_content|wpautop|shortcodes }}

    On my other Post Type, it was

    {{ page.content|wpautop|shortcodes }}

    so I replace the first line by the second and it works.

    Thanks for your spending time

  7. 1 year, 2 months ago Andrew Misplon Hi, I Work Here

    Super. Really glad to hear you’ve made progress. Thanks for keeping us updated and posting your fix.

    Cheers for now.

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More