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
//Code to display ACF checkboxes as list | |
add_shortcode('acfBr', 'brListFunction'); | |
function brListFunction($atts, $content) { | |
extract(shortcode_atts(array("id"=>'','field'=>''),$atts)); | |
if($field){ | |
if($id=''){ | |
global $post; | |
$id=$post->ID; | |
} |
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_action( 'woocommerce_before_shop_loop_item_title', 'popcorn_new_badge_shop_page', 3 ); // on commence par la position où va se trouver le badge, puis on créé une fonction | |
function popcorn_new_badge_shop_page() { | |
global $product; | |
$newness_days = 30; //ici on met le nombre jours, nouveautés sur les 30 derniers jours dans ce cas présent | |
$created = strtotime( $product->get_date_created() ); | |
if ( ( time() - ( 60 * 60 * 24 * $newness_days ) ) < $created ) { | |
echo '<span class="itsnew onsale">' . esc_html__( 'Nouveauté!', 'woocommerce' ) . '</span>'; |
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_filter( 'loop_shop_per_page', 'new_loop_shop_per_page', 20 ); | |
function new_loop_shop_per_page( $cols ) { | |
// $cols contains the current number of products per page based on the value stored on Options -> Reading | |
// Return the number of products you wanna show per page. | |
$cols = 9 //ici on met le nombre d'articles que l'on souhaite voir par page | |
return $cols; |
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 | |
* Change number or products per row to 3 | |
*/ | |
add_filter('loop_shop_columns', 'loop_columns', 999); | |
if (!function_exists('loop_columns')) { | |
function loop_columns() { | |
return 3; // 3 products per row | |
} | |
} |
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
Modifier le nombre de produtis par colonne dans la page Archives | |
[recent_products per_page="12" columns="5"] will display the products in rows of 5 columns. |
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
//À utiliser dans la page du Panier | |
[woocommerce_cart] | |
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_filter( 'woocommerce_breadcrumb_defaults', 'jk_woocommerce_breadcrumbs' ); | |
function jk_woocommerce_breadcrumbs() { | |
return array( | |
'delimiter' => ' / ', | |
'wrap_before' => '<nav class="woocommerce-breadcrumb" itemprop="breadcrumb">', | |
'wrap_after' => '</nav>', | |
'before' => '', | |
'after' => '', |
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_filter( 'woocommerce_breadcrumb_home_url', 'woo_custom_breadrumb_home_url' ); | |
function woo_custom_breadrumb_home_url() { | |
return 'http://woocommerce.com'; | |
} | |
Pour StoreFrton, remplacer : add_filter( 'woocommerce_breadcrumb_defaults', 'woo_custom_breadrumb_home_url', 20 ); |
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_action( 'woocommerce_after_order_notes', 'bbloomer_notice_shipping' ); | |
function bbloomer_notice_shipping() { | |
echo '<p class="allow">Please allow 5-10 business days for delivery after order processing.</p>'; | |
} |
OlderNewer