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_product_tabs', 'cwp_woo_disqus_tab'); | |
function cwp_woo_disqus_tab($tabs) { | |
$tabs['disqus_tab'] = array('title' => __('留言') , 'priority' => 50, 'callback' => 'cwp_woo_disqus_tab_content'); | |
return $tabs; | |
} | |
function cwp_woo_disqus_tab_content() { |
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
/** | |
* Changes the redirect URL for the Return To Shop button in the cart. | |
* | |
* @return string | |
*/ | |
function wc_empty_cart_redirect_url() { | |
return 'http://yourdomain.com/your-page/'; | |
} | |
add_filter( 'woocommerce_return_to_shop_redirect', 'wc_empty_cart_redirect_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
// WooCommerce 台灣結帳表單 城市下拉選項 | |
add_filter('woocommerce_states', 'cwp_woocommerce_tw_states'); | |
function cwp_woocommerce_tw_states($states) { | |
$states['TW'] = array( | |
'基隆市' => '基隆市', | |
'台北市' => '台北市', | |
'新北市' => '新北市', |
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 自訂結帳欄位排序 | |
add_filter('woocommerce_default_address_fields', 'cwp_custom_address_fields'); | |
function cwp_custom_address_fields($fields) { | |
// 依照需要的欄位調整順序 | |
$fields2['country'] = $fields['country']; | |
$fields2['first_name'] = $fields['first_name']; | |
$fields2['last_name'] = $fields['last_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
// WooCommerce 台灣結帳表單 城市下拉選項 | |
add_filter('woocommerce_states', 'cwp_woocommerce_tw_states'); | |
function cwp_woocommerce_tw_states($states) { | |
$states['TW'] = array( | |
'基隆市' => '基隆市', | |
'台北市' => '台北市', | |
'新北市' => '新北市', |
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
// 企業用 Google Knowledge Graph | |
function cwp_google_knowledge_graph() { | |
if (is_front_page()) { | |
echo '<script type="application/ld+json"> | |
{ "@context" : "http://schema.org", | |
"@type" : "Organization", | |
"name" : "cloudwp", //機構名稱 | |
"url" : "https://cloudwp.pro", //網站網址 | |
"logo" : "https://assets.cloudwp.pro/images/logo-gkg.png", //logo連結 | |
"contactPoint" : [ |
NewerOlder