DFI WooCommerce FacetWP
-
Hey Janw – Thanks for creating this awesome, free plugin! I’m currently using it to display default images for my WooCommerce products; I have a featured image per product tag and everything works beautifully. The only setback I’m having right now is displaying my default product images when using the FacetWP plugin, which seems to ignore the DFI images. I’m using the basic code below for testing purposes, which only displays the actual, uploaded featured image instead of the one that I’ve set using DFI. Not sure what I’m missing but any help is much appreciated!
FacetWP code:
<ul class="products"> <?php while ( have_posts() ) : the_post(); ?> <li><?php the_post_thumbnail(); ?></li> <?php endwhile; ?> </ul>
DFI code for one of my WC tags (I have several of these):
function dfi_tag_gameon ( $dfi_id, $post_id ) { if ( has_term( 'game-on', 'product_tag', $product ) ){ return 1155; // the image id } return $dfi_id; // the original featured image id } add_filter( 'dfi_thumbnail_id', 'dfi_tag_gameon', 10 , 2 );
https://www.ads-software.com/plugins/default-featured-image/
- The topic ‘DFI WooCommerce FacetWP’ is closed to new replies.