Last active
August 29, 2015 14:07
-
-
Save dryan1144/ef67b67b8f7fac8dad40 to your computer and use it in GitHub Desktop.
Add default iThemes Exchange product image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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