Last active
January 17, 2018 12:42
-
-
Save gregoirenoyelle/7b14428924128c479156d07020039746 to your computer and use it in GitHub Desktop.
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 | |
/***** | |
* Voir les hook dans les fichiers: | |
* /woocommerce/includes/wc-template-hooks.php | |
* Les fonctions sont ajoutées à un fichier dédié dans mon thème qui est appelé depuis le | |
* le fichier principal: functions.php | |
*/ | |
// Ajout de texte avant les vignettes | |
add_action( 'woocommerce_before_shop_loop_item_title', 'gn_contenu_avant_vignette', 5); | |
function gn_contenu_avant_vignette() { | |
echo '<div>Avant les vignettes</div>'; | |
} | |
// Ajout de contenu après les vignettes | |
add_action( 'woocommerce_shop_loop_item_title', 'gn_contenu_apres_vignette', 5 ); | |
function gn_contenu_apres_vignette() { | |
echo '<div>Après les vignettes</div>'; | |
} | |
// Suppression des vignettes. Oui, carrément! | |
// remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 ); | |
// Changement de place pour ajouter au panier | |
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 ); | |
add_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_add_to_cart', 4); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment