• Resolved kimpahl1111

    (@kimpahl1111)


    Hello. I was happy to find this plugin and installed it. Works great so far, however, I use WooCommerce as my shopping cart and you have to use the featured image for the main product image to show up on the product page. So, once I installed your plugin it’s putting the featured image on all of my product pages above the product information & images. It’s doing what it’s suppose to do, but I don’t want this for obvious reasons in my shopping cart. You can see an example here. How can I stop this but leave it on all of my blog posts? Thanks so much!

    https://wordpress.org/plugins/display-featured-image-genesis/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Robin Cornett

    (@littlerchicken)

    You’ll want to use a filter to tell the plugin not to run on WooCommerce products and related pages. This code should be a decent starting point:

    add_filter( 'display_featured_image_genesis_skipped_posttypes', 'rgc_skip_these_types' );
    function rgc_skip_these_types( $post_types ) {
    	$post_types[] = 'product' === get_post_type(); // should target any woocommerce product/archive
    	$post_types[] = is_single( array( 'cart', 'account' ) ); // list of pages created by woo
    
    	return $post_types;
    }

    Basically you are creating a list of pages that should not use the plugin for the featured image. The first line should exclude it from all of the products and their archives; the second is a list you’ll have to build using the pages that Woo creates for the cart, etc. You can use either the slugs or IDs. It may help to check the Conditional Tags reference in the Codex. Hope that helps!

    Thread Starter kimpahl1111

    (@kimpahl1111)

    Thank you for responding so quickly! I’ve chosen not to use the plugin for this web site rather than messing w/ having to do all that at this time. I will, however, keep your plugin for future reference for other sites. Appreciate that you are here for help (lots of others are not) so way to go! Thanks so much!

    Hi,

    Looking to show featured images on just catalogues and not individual product pages. Can the code above be updated to filter products or catalogues and not both?

    Thanks

    Ken

    Plugin Author Robin Cornett

    (@littlerchicken)

    Yes, if you change the $post_types[] = 'product' === get_post_type(); line to $post_types[] = is_singular( 'product' );, then the individual product pages would be skipped, but not the product category pages. Hope that helps!

    Hi Robin,

    That’s great, is there any way to define a custom image rather than large or full size?

    Thanks

    Ken

    Plugin Author Robin Cornett

    (@littlerchicken)

    Well, the plugin will use either its own image size (2000 pixels) or the large image size. I suppose it’s possible to introduce a filter to change this to a different registered image size. I’ll look into it for the next release.

    Hi Robin,

    After updating the plugin these filters do not work anymore for some reason:

    $post_types[] = is_singular( ‘product’ );
    $post_types[] = ‘product’ === get_post_type();

    Featured image is shown on every product page now.

    Plugin Author Robin Cornett

    (@littlerchicken)

    My apologies for that–I will get a fix pushed out today. You can download the affected file from Github: it’s /includes/class-displayfeaturedimagegenesis-common.php. You should be able to FTP this onto your site and replace the existing one if you need it before the fix is available from here.

    Another option is to use the new “skip content type” setting in the plugin settings, but the plugin will be updated to correct the existing filters.

    Good day Robin!
    Thanks for your immediate update!
    Awaiting for the fix to arrive, thanks again.
    Kind regards

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Do not show featured image in WooCommerce’ is closed to new replies.