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
/** | |
* Default is ASC, change to DESC | |
**/ | |
add_action( 'pre_get_posts', 'custom_kiwi_order' ); | |
function custom_kiwi_order( $query ) { | |
if ( is_home() && $query->is_main_query() ) | |
$query->set( 'post_type', 'kwlogos' ); | |
$query->set( 'order' , 'desc' ); | |
return $query; | |
} |
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 Post Type & Post Name to Body Class | |
* For example: page-about-us | |
*/ | |
add_filter('body_class', 'add_post_class'); | |
function add_post_class($classes) { | |
global $post; | |
if ( isset( $post ) ) { | |
$classes[] = $post->post_type . '-' . $post->post_name; | |
} |
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
/** | |
* Can change Seller to any name you want to change | |
*/ | |
function rename_sold_by($text) { | |
$return = str_replace('Sold by', 'Seller', $text); | |
return $return; | |
} | |
add_filter('wcvendors_sold_by_in_loop', 'rename_sold_by'); // Product Loop | |
add_filter('wcvendors_cart_sold_by', 'rename_sold_by'); // Cart Page | |
add_filter('wcvendors_cart_sold_by_meta', 'rename_sold_by'); // Single Product Page |
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
//WooCommerce Remove Sidebar | |
remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10 ); |
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_filter( 'woocommerce_available_payment_gateways', 'bacs_disable_outside_singapore' ); | |
//Disable bacs if the country not in Singapore | |
function bacs_disable_outside_singapore( $available_gateways ) { | |
global $woocommerce; | |
if ( isset( $available_gateways['bacs'] ) && $woocommerce->customer->get_country() <> 'SG' ) { | |
unset( $available_gateways['bacs'] ); | |
} | |
return $available_gateways; | |
} |