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 action_woocommerce_calculate_totals( ) { | |
global $woocommerce; | |
$woocommerce->cart->shipping_tax_total = 0; | |
}; | |
add_action( 'woocommerce_calculate_totals', 'action_woocommerce_calculate_totals', 10, 1 ); |
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 | |
/* | |
Custom Placeholder Image - shows when product hasn't got an image | |
Author: Bartek Makowski | |
*/ | |
//inside wp-content/themes/{template}/functions.php | |
add_action('init', 'custom_fix_thumbnail'); |
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 | |
/* | |
WP All Import DB Fix for showing incorrect users number | |
on WP Dashboard | |
Author: Bartek Makowski | |
*/ | |
//inside main wordpress folder |
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 | |
/* | |
Example 1 - custom post type without category | |
Author: Bartek Makowski | |
*/ | |
//inside wp-content/themes/{template}/functions.php | |
function create_post_type() { |
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( 'wp_logout', create_function( '', 'wp_redirect( home_url() ); exit();') ); |
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_hide_shipping_when_free_is_available( $rates ) { | |
$free = array(); | |
foreach ( $rates as $rate_id => $rate ) { | |
if ( 'free_shipping' === $rate->method_id ) { | |
$free[ $rate_id ] = $rate; | |
break; | |
} | |
} | |
return ! empty( $free ) ? $free : $rates; |
NewerOlder