Skip to content

Instantly share code, notes, and snippets.

@dryan1144 dryan1144/functions.php
Last active Aug 29, 2015

Embed
What would you like to do?
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
You can’t perform that action at this time.