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
article.post .post-content { | |
width: 100%; | |
} | |
.single article.post .post-content { | |
width: 96%; | |
} | |
aside.post-meta { | |
display: none !important; |
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( 'post_row_actions', 'remove_duplicate_capability', 20, 2 ); | |
add_filter( 'page_row_actions', 'remove_duplicate_capability', 20, 2 ); | |
function remove_duplicate_capability( $actions, $post ) { | |
if ( $post->post_type != 'product' ) { | |
return $actions; | |
} | |
if ( isset( $actions['duplicate'] ) ) { | |
unset( $actions['duplicate'] ); | |
} |
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
/** | |
* Sell only in California | |
*/ | |
function wc_sell_only_states( $states ) { | |
$states['US'] = array( | |
'CA' => __( 'California', 'woocommerce' ), | |
'TX' => __( 'Texas', 'woocommerce' ), | |
); | |
return $states; | |
} |
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_action( 'woocommerce_after_shop_loop_item_title', 'custom_print_stock', 9 ); | |
function custom_print_stock() { | |
global $product; | |
printf( '<span>Available: %d</span>', esc_html( $product->get_stock_quantity() ) ); | |
} |
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
remove_action( 'woocommerce_proceed_to_checkout', 'woocommerce_button_proceed_to_checkout', 20 ); | |
add_action( 'woocommerce_proceed_to_checkout', 'change_url_to_checkout', 20 ); | |
function change_url_to_checkout() { | |
$cart = WC()->cart->get_cart(); | |
$url = ''; | |
foreach ( $cart as $item ) { | |
if ( $item['product_id'] === 70 ) { | |
$url = 'put_your_extra_page_url_here'; | |
break; |
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_action( 'init', 'remove_jpcf_nonadmin' ); | |
function remove_jpcf_nonadmin() { | |
if ( ! current_user_can( 'manage_woocommerce' ) ) { | |
remove_action( 'media_buttons', 'grunion_media_button', 999 ); | |
} | |
} |
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
ul.products li.product .onsale { | |
position: absolute; | |
top: 200px; | |
right: 85px; | |
} |
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
.onsale { | |
background-color: #FFFFFF; | |
border-color: #FF0000 !important; | |
color: #FF0000 !important; | |
} |
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
/** | |
* Change the Shop archive page title. | |
* @param string $title | |
* @return string | |
*/ | |
function wc_custom_shop_archive_title( $title ) { | |
if ( is_shop() && isset( $title['title'] ) ) { | |
$title['title'] = 'My Title'; | |
} |
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_action( 'woocommerce_order_status_completed', 'change_role_on_purchase' ); | |
function change_role_on_purchase( $order_id ) { | |
$order = wc_get_order( $order_id ); | |
$items = $order->get_items(); | |
$products_to_check = array( '1', '2', '3' ); | |
foreach ( $items as $item ) { | |
if ( $order->user_id > 0 && in_array( $item['product_id'], $products_to_check ) ) { | |
$role = 'new-role'; |