by Nick | Jun 22, 2022 | Code
Add this to the functions.php file and then add the shortcode of [shippingleft] to get it to show up. function how_much_shipping_is_left() { $min_amount = 100; //change this to your free shipping threshold $current = WC()->cart->subtotal; if ( $current <...
by Nick | Feb 15, 2022 | Code
Add this to the functions.php to hide Klarna payment method if the order total is under £35 //hide klarna if order total is under £35 add_filter( 'woocommerce_available_payment_gateways', 'rudr_turn_off_cod' ); function rudr_turn_off_cod( $available_gateways ) { if(...
by Nick | Jan 21, 2021 | Code
Use this to find all the additional image sizes your site is using /* Output all image sizes on the frontend ---------------------------------------------------------------------------------------------------- */ add_action('init', 'get_all_image_sizes'); function...
by Nick | Oct 18, 2020 | Code
Add this to your functions files to disable/remove the Divi CPT CSS file from being used. /* Disable Divi CPT CSS */ function disable_cptdivi() { remove_action( 'wp_enqueue_scripts', 'et_divi_replace_stylesheet', 99999998 ); } add_action('init', 'disable_cptdivi');...
by Nick | Jul 6, 2020 | Code
To enable error logging, create an empty file named “php-errors.log”. Place it in a directory that is not publicly accessible (preferably outside your web root) and ensure it is writable by the web server. Then add the following code to wp-config.php:...
by Nick | Jul 23, 2018 | Code
Use this to remove query strings from static resources in WordPress // Remove query strings from static resources function _remove_script_version( $src ){ $parts = explode( '?ver', $src ); return $parts[0]; } add_filter( 'script_loader_src',...
Recent Comments