• Resolved tnightingale

    (@tnightingale)


    Hi – I just discovered your plugin and it’s just what I need to hide/show blocks based on device type. I don’t really need all the other features but I’m sure some will come in handy. Thank you!
    However, I (and other editors) have noticed this behaviour since installing the plugin: when editing a page for the first time with the plugin activated, if we add an image in the content somewhere (e.g. adding an image block or adding an image to an empty image block, from media library or upload), after saving the change, the Featured Image for the page disappears (has been unset). This only happens once per page; if I put the Featured image back, then add images to the page, it keeps the featured image as expected.
    I also tried editing another page and re-saving it first before making any changes – in that situation, the featured image doesn’t disappear after adding images. So it’s something to do with the first time a page is edited after adding the plugin.
    Running latest WP with the latest version of Gutenberg plugin. Also using Advanced Gutenberg plugin.
    Hope you can fix. It’s easy to work around but a bug nonetheless and would catch people by surprise.

Viewing 4 replies - 1 through 4 (of 4 total)
  • @tnightingale I’ve tried to replicate the issue and I can’t seem to create similar issue. I’ll let you know when I’ve figure the conflict/bugs are. Do you have the Gutenberg plugin installed or are you using the one built-in on core WordPress? Thanks!

    Thread Starter tnightingale

    (@tnightingale)

    Hi – as mentioned in the initial post I’m using the Gutenberg plugin as well as the core version.
    Also upon further testing, saving the page before making any other changes doesn’t prevent the featured image from going missing after all.

    If no one else has found this issue, you can ignore it, it may be specific to the combination of plugins I’m using. I ended up removing your plugin after realizing it only uses CSS to hide the mobile/desktop blocks, rather than php conditionals. I need the hidden blocks to not be in the markup at all – trying to avoid loading large images onto mobile devices. Since I was using the plugin for a reusable block in the site footer, I was able to just code what I needed into the template file instead, using ACF options fields to make them editable.

    Thanks,
    Teresa

    @tnightingale Thanks for info, I will still try to replicate the issue to see what’s causing it. Regarding the markup, CSS is the best option to hide elements on mobile devices. If you are using PHP and your website is using cache then the markups won’t be reliable when hidden. Also, most of the modern browsers do not load hidden images of page load so your page will be intact and users can browse on them perfectly. I hope this could help too. Thanks!

    Thread Starter tnightingale

    (@tnightingale)

    Hi, can you show me documentation that modern mobile browsers are not loading hidden images? I have not seen anything about that. Just googled and found nothing different. Only background images can be prevented from loading with CSS. I am not trying to hide background images.

    Caching is not a problem, the caching plugin I use has a setting to keep separate caches for mobile and desktop.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Feature image removed after adding an image in the content’ is closed to new replies.