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 | |
| function my_custom_mime_types( $mimes ) { | |
| // New allowed mime types. | |
| $mimes['svg'] = 'image/svg+xml'; | |
| $mimes['svgz'] = 'image/svg+xml'; | |
| $mimes['doc'] = 'application/msword'; | |
| // Optional. Remove a mime type. | |
| unset( $mimes['exe'] ); |
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 | |
| // disable xmlrpc | |
| add_filter( 'xmlrpc_enabled', '__return_false' ); |
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(d) { | |
| var phone = '+1234567'; | |
| var text = "Hello, I'm interested for: " + window.location.href; | |
| if(!window.location.pathname.startsWith("/products")){ | |
| text = "Hello, I'm interested.."; | |
| } | |
| var link = d.createElement('a'); | |
| var style = d.createElement('style'); |
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 | |
| // set language attribute of the main <html> tag hardcoded | |
| function new_language_attributes($lang){ | |
| return "lang=\"it\""; | |
| } | |
| add_filter('language_attributes', 'new_language_attributes'); |
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 | |
| // set language attribute of the main <html> tag based on category value | |
| function new_language_attributes($lang){ | |
| if(is_single()) { | |
| $ar = get_the_category(); | |
| foreach($ar as $c) { | |
| if($c->slug=='in-italiano') { | |
| return "lang=\"it\""; | |
| } |
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 | |
| // clear cart before adding new one | |
| add_filter( 'woocommerce_add_to_cart_validation', 'remove_cart_item_before_add_to_cart', 20, 3 ); | |
| function remove_cart_item_before_add_to_cart( $passed, $product_id, $quantity ) { | |
| if( ! WC()->cart->is_empty() ) | |
| WC()->cart->empty_cart(); | |
| return $passed; | |
| } |
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 | |
| // redirect Add To Cart > Checkout | |
| add_filter ('woocommerce_add_to_cart_redirect', function( $url, $adding_to_cart ) { | |
| return wc_get_checkout_url(); | |
| }, 10, 2 ); |
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 | |
| add_action( 'woocommerce_checkout_after_terms_and_conditions', 'custom_woocommerce_empty_cart_button' ); | |
| function custom_woocommerce_empty_cart_button() { | |
| echo '<a href="/?empty_cart=yes" class="rq-btn rq-btn-transparent" title="' . esc_attr( 'Cancel Order', 'woocommerce' ) . '">' . esc_html( 'Cancel Order', 'woocommerce' ) . '</a>'; | |
| // echo '<a href="' . esc_url( '/cart' . add_query_arg( 'empty-cart', 'yes' ) ) . '" class="rq-btn rq-btn-transparent" title="' . esc_attr( 'Cancel Order', 'woocommerce' ) . '">' . esc_html( 'Cancel Order', 'woocommerce' ) . '</a>'; | |
| } | |
| add_action( 'wp_loaded', 'custom_woocommerce_empty_cart_action', 20 ); | |
| function custom_woocommerce_empty_cart_action() { |
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 | |
| add_filter( 'woocommerce_return_to_shop_redirect', 'mysite_change_return_shop_url' ); | |
| function mysite_change_return_shop_url() { | |
| return home_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
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" /> | |
| <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" /> | |
| <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tw-elements/dist/css/index.min.css" /> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <script> | |
| tailwind.config = { | |
| theme: { | |
| extend: { | |
| fontFamily: { | |
| sans: ['Inter', 'sans-serif'], |