Support » Plugin: Conditionally display featured image on singular posts and pages » Seems to hide whole gallery on product page?

  • Hi,

    I’ve been looking for a solution that works with Woo commerce product pages.

    When I tick the box to hide featured image on the page, it hides the whole gallery. I’m trying to hide just the featured image.

    I’ve tried various code and thought I’d hit the jackpot when I saw this lovely plugin!

    Can you confirm if the code is doing this intentionally or is there a way to isolate the featured image so that it wont interfere with gallery plugins?

    I’m not seeing any errors in the console, and when I inspect the page, the entire gallery no longer exists.

    I would really appreciate your help with this, and it would be great to be able to state it works well for product pages 🙂

    many thanks,
    David

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author cyrillbolliger

    (@cyrillbolliger)

    Hi David

    Thanks for using the Conditionally display featured image on singular posts and pages plugin.

    I’ve just tested your situation with the latest version of WooCommerce, WordPress and the TwentyTwenty theme. However I could not reproduce the behavior you described. In fact, I’ve even noticed, that the plugin doesn’t have any effect on the product page at all. I therefore assume, the problem is related to the theme your using. What theme do you use and what function does it use to output the featured image and the gallery?

    Have an excellent day,
    Cyrill

    Hi Cyrill,

    Many thanks for testing this for me.

    I have just updated wordpress, woocommerce and the TwentyTwenty theme to the latest versions and disabled every plugin other than woocommerce and your plugin. I switched to the TwentyTwenty theme and still no joy! The featured image is still there. And I purged the cache, hard refreshed browser, etc.

    It’s quite baffling!

    The only time I saw a difference was when I had the product image gallery/slider installed, but it was hiding the whole gallery, changing the containing div from this:

    <div class="wpgs wpgs--with-images images">

    to this, when excluding the featured image via your plugin:

    <div class="wpgs wpgs--without-images images">

    So it seems to think that there are no images because it cant find the first one?

    The slider plugin is called Ci WooCommerce Product Gallery Slider by codeixer incase yo want to test this behaviour. I’m just using the free version.

    Any ideas what else could be stopping your plugin working on my site? Any tests I can run? Like I say, there are no errors in the console.

    Just reading your response again, and are you saying that the plugin didnt have any effect on product pages? In otherwords, you can confirm that it doesnt work on product pages? If so, any chance you could make it work? 😀

    Many thanks,
    David

    • This reply was modified 1 month, 1 week ago by potticus.

    Hi Cyrill,

    I’ve managed to find a free slider plugin that works in conjunction with your plugin: Dynamic Product Gallery for WooCommerce.

    Typically though, it actually includes a “hide featured image” option itself, which also works.

    Will still keep your plugin for other page types though 😉

    Many thanks,
    David

    Plugin Author cyrillbolliger

    (@cyrillbolliger)

    Hi David

    Thanks a lot for sharing your solution: Dynamic Product Gallery for WooCommerce.

    The Conditionally display featured image on singular posts and pages plugin relies on the usage of one of wp_get_attachment_image(), get_the_post_thumbnail() or the_post_thumbnail(). If the theme or plugin that generates your markup does not use any of those functions, there is unfortunately no way for this plugin to work. It is therefore highly dependent on the functioning of the theme and other plugins – although the three functions mentioned are the standard way of dealing with featured images. This is the reason why the plugin only works with most, but not all themes and plugins.

    Have an excellent day,
    Cyrill

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this review.