Skip to content

Instantly share code, notes, and snippets.

Verifying my Blockstack ID is secured with the address 1MK7NHe5i2AhTxDUm4dCs7GiopdSfZ1b7C https://explorer.blockstack.org/address/1MK7NHe5i2AhTxDUm4dCs7GiopdSfZ1b7C
@PeterKnight
PeterKnight / gist:5994961
Created July 14, 2013 17:10
This is example code that will hide the image markup for Woocommerce products if a product does not have a thumbnail. Useful if you are displaying a service for example that doesn't have a product image.
function before_no_image_product() {
if( !has_post_thumbnail( get_the_id() ) ){
remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 );
echo '<div class="no-image">';
}
}
function after_no_image_product() {
if( !has_post_thumbnail( get_the_id() ) ){