Skip to content

Instantly share code, notes, and snippets.

View myalban's full-sized avatar
🤠
Available

Alban DOUSSAU de GUYONNET myalban

🤠
Available
View GitHub Profile
@myalban
myalban / custom-woocommerce-shop-loop-thumbnail-and-title.php
Created September 4, 2020 21:22 — forked from ben-heath/custom-woocommerce-shop-loop-thumbnail-and-title.php
Custom WooCommerce Shop Loop Product Thumbnail and Title
<?php
/**
* Check if WooCommerce is active
**/
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
// remove product thumbnail and title from the shop loop
remove_action( 'woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10 );
remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 );
@ben-heath
ben-heath / custom-woocommerce-shop-loop-and-single-product-thumbnail-and-title.php
Created September 7, 2016 20:06
Respondo Pro Removal of /woocommerce/single-product/product-image.php file and content-product.php file
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
remove_action( 'woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10 );
remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 );
add_action( 'woocommerce_before_shop_loop_item_title', 'sls_woocommerce_template_loop_product_thumbnail', 10 );
function sls_woocommerce_template_loop_product_thumbnail() {
echo '<a class="thumbnail" title="'.get_the_title().'" href="'. get_the_permalink() . '">'.woocommerce_get_product_thumbnail().'</a>';
echo '<h3><a href="'.get_the_permalink().'">'.get_the_title().'</a></h3>';
}
@ben-heath
ben-heath / custom-woocommerce-shop-loop-thumbnail-and-title.php
Last active September 21, 2021 03:41
Custom WooCommerce Shop Loop Product Thumbnail and Title
<?php
/**
* Check if WooCommerce is active
**/
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
// remove product thumbnail and title from the shop loop
remove_action( 'woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10 );
remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 );