This file contains hidden or 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 | |
| /** | |
| * Anti-Fraude WooCommerce - Détection "Apt 1" / téléphone "+33 9" | |
| * | |
| * À inclure depuis functions.php du thème enfant : | |
| * require_once get_stylesheet_directory() . '/inc/anti-fraude-apt1.php'; | |
| * | |
| * Bloque et bannit toute commande dont l'adresse 2 (facturation ou livraison) | |
| * est exactement "Apt 1" OU dont le téléphone (facturation ou livraison) est | |
| * exactement "+33 9". Annule la commande, bannit l'IP dans Wordfence |
This file contains hidden or 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 | |
| /** | |
| * Hook simple pour ajouter une image à la une via URL | |
| * Ajouter ce code dans functions.php ou un fichier must-use plugin | |
| */ | |
| // Ajouter la métabox | |
| add_action('add_meta_boxes', function() { | |
| add_meta_box( | |
| 'featured_image_url', |
This file contains hidden or 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
| /** | |
| * @param $interval - The interval between each delay, defaults to 500ms | |
| * @param $startTime - The start time of the animations, defaults to 0ms | |
| * @param $numberOfDelays - The total number of delays to be generated, defaults to 10 | |
| */ | |
| @mixin delays($interval: 500, $startTime: 0, $numberOfDelays: 10) { | |
| @for $i from 0 through $numberOfDelays { | |
| $ms : $startTime + ($i * $interval); | |
| &.delay-#{$ms} { | |
| animation-delay: #{$ms}ms; |
This file contains hidden or 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
| /* Convert the standard WooCommerce products list into a modern responsive grid. */ | |
| ul.products { | |
| --grid-gap: 32px; | |
| --auto-grid-min-size: 200px; | |
| grid-template-columns: repeat(auto-fill, minmax(var(--auto-grid-min-size), 1fr)); | |
| grid-gap: var(--grid-gap); | |
| display: grid; | |
| } | |
| ul.products:before{ | |
| content:unset!important; |
This file contains hidden or 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
| function add_blog_category_color(){ | |
| $categories = get_categories(array( 'hide_empty' => 0, )); | |
| if ( ! empty( $categories ) ) { | |
| echo '<style type="text/css">'; | |
| foreach( $categories as $category ) { | |
| $category_taxonomy = $category->taxonomy; | |
| $category_id = $category->term_id; | |
| $category_slug = $category->slug; | |
| $category_color = get_field('blog_category_color',$category_taxonomy . '_' . $category_id); |
This file contains hidden or 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
| /** | |
| * Optimize WooCommerce Scripts | |
| * Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages. | |
| */ | |
| add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 ); | |
| function child_manage_woocommerce_styles() { | |
| //remove generator meta tag | |
| remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); |
This file contains hidden or 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
| /** | |
| * Optimize WooCommerce Scripts | |
| * Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages. | |
| */ | |
| add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 ); | |
| function child_manage_woocommerce_styles() { | |
| //remove generator meta tag | |
| remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); |
This file contains hidden or 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
| # add this script in product liquid (Just before addtocart form) | |
| <!-- Code added for Inventory in Pipeline --> | |
| <script> | |
| var inv_qty = {}; | |
| {% for var in product.variants %} | |
| inv_qty[{{- var.id -}}] = {{ var.inventory_quantity | default: 0 }}; | |
| {% endfor %} | |
| </script> | |
| {% if current_variant.inventory_management == "shopify" %} |
This file contains hidden or 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
| <!-- // The HTML (could be part of page content) // --> | |
| <input type="text" name="keyword" id="keyword" onkeyup="fetch()"></input> | |
| <div id="datafetch">Search results will appear here</div> |
This file contains hidden or 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 | |
| /** | |
| * This is free and unencumbered software released into the public domain. | |
| * | |
| * Anyone is free to copy, modify, publish, use, compile, sell, or | |
| * distribute this software, either in source code form or as a compiled | |
| * binary, for any purpose, commercial or non-commercial, and by any | |
| * means. | |
| * |
NewerOlder