Skip to content

Instantly share code, notes, and snippets.

@dryan1144
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dryan1144/ef67b67b8f7fac8dad40 to your computer and use it in GitHub Desktop.
Save dryan1144/ef67b67b8f7fac8dad40 to your computer and use it in GitHub Desktop.
Add default iThemes Exchange product image
<?php
/*
------------------------------------------------------------------------------------------
Add default thumbnail for products on Store page
------------------------------------------------------------------------------------------
*/
function custom_exchange_default_product_image() {
if ( ! it_exchange( 'product', 'has-featured-image' ) ) { ?>
<?php do_action( 'it_exchange_content_store_before_featured_image_element' ); ?>
<a class="it-exchange-product-feature-image" href="<?php it_exchange( 'product', 'permalink', array( 'format' => 'url' ) ); ?>">
<div class="it-exchange-feature-image-0 it-exchange-featured-image">
<div class="featured-image-wrapper">
<img alt="" src="IMG-URL-HERE.jpg" data-src-large="IMG-URL-HEREjpg" data-src-thumb="img-150x150.jpg">
</div>
</div>
</a>
<?php do_action( 'it_exchange_content_store_after_featured_image_element' );
}
}
add_action( 'it_exchange_content_store_begin_product_element', 'custom_exchange_default_product_image' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment