(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({‘gtm.start’: new Date().getTime(),event:’gtm.js’});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!=’dataLayer’?’&l=’+l:”;j.async=true;j.src= ‘https://www.googletagmanager.com/gtm.js?id=’+i+dl;f.parentNode.insertBefore(j,f); })(window,document,’script’,’dataLayer’,’GTM-W23H2FM’);Continue reading
// 設定 WordPress 記憶體限制 define(‘WP_MEMORY_LIMIT’, ‘256M’); define(‘WP_MAX_MEMORY_LIMIT’, ‘512M’); // 設定 PHP 執行層的上傳限制 @ini_set(‘upload_max_filesize’, ’64M’); @ini_set(‘post_max_size’, ’64M’); @ini_set(‘max_execution_time’, ‘300’);Continue reading
add_action(‘init’, function() { global $wp_post_types; if (isset($wp_post_types[‘awb_off_canvas’])) { $wp_post_types[‘awb_off_canvas’]->public = true; } }, 11);Continue reading
add_filter( ‘sgo_bypass_query_params’, ‘add_sgo_bypass_query_params’); function add_sgo_bypass_query_params( $bypass_query_params ) { // Add custom query params, that will skip the cache. $bypass_query_params[] = ‘condis’; return $bypass_query_params; }Continue reading
function shortcode_categorie_principali_wc() { $args = array( ‘taxonomy’ => ‘product_cat’, ‘orderby’ => ‘menu_order’, ‘order’ => ‘ASC’, ‘hide_empty’ => false, ‘parent’ => 0, ‘pad_counts’ => true, ‘hierarchical’ => true, ); $categories = get_terms($args); if (empty($categories) || is_wp_error($categories)) { return ‘ Nessuna categoria…Continue reading
#== Remove Express Checkout Button for Wholesale Users ==# function remove_express_checkout_button() { global $wp_filter, $wc_wholesale_prices; $user_wholesale_role = $wc_wholesale_prices->wwp_wholesale_roles->getUserWholesaleRole(); if( empty( $user_wholesale_role ) ) { return; } $hooks_to_clean = [ ‘woocommerce_after_add_to_cart_form’ => 1, ‘woocommerce_proceed_to_checkout’ => 21, ‘woocommerce_checkout_before_customer_details’ => 1, ‘woocommerce_pay_order_before_payment’ =>…Continue reading
add_action( ‘pre_get_posts’, ‘exclude_selected_categories_from_shop’ ); function exclude_selected_categories_from_shop( $query ) { if ( ! is_admin() && $query->is_main_query() && is_shop() ) { $query->set( ‘tax_query’, array( array( ‘taxonomy’ => ‘product_cat’, ‘field’ => ‘slug’, ‘terms’ => array( ‘home’, ‘peptides’, ‘research-liquids’, ‘package-deals’ ), ‘operator’ => ‘NOT…Continue reading
add_filter( ‘loop_shop_per_page’, ‘show_all_products_on_shop_page’, 9999 ); function show_all_products_on_shop_page( $products ) { if ( is_shop() ) { return 9999; // Show up to 9999 products on the shop page } return $products; }Continue reading
// Step 1: Add your custom attribute(s) to a named group function add_custom_grouped_attributes( $attributes ) { // Define your own group label here $group_label = ‘Other fields’; // e.g., ‘Image attributes’, ‘Custom data’, etc. // Initialize group if not set…Continue reading