This file contains 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
/** | |
* Disable out of stock variations | |
* https://github.com/woocommerce/woocommerce/blob/826af31e1e3b6e8e5fc3c1004cc517c5c5ec25b1/includes/class-wc-product-variation.php | |
* @return Boolean | |
*/ | |
function wcbv_variation_is_active( $active, $variation ) { | |
if( ! $variation->is_in_stock() ) { | |
return false; | |
} | |
return $active; |
This file contains 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 | |
//* DON'T ADD ABOVE | |
/* | |
* | |
* READ ME: | |
* I'm using Beaver Builder for page post types and I don't want that option on | |
* WooCommerce store, cart, checkout, and my account pages. I don't want the client to ask why she can't change |
This file contains 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_shortcode( 'post_category', 'sk_post_category_shortcode' ); | |
/** | |
* Produces the first category link. | |
* | |
* Supported shortcode attributes are: | |
* after (output after link, default is empty string), | |
* before (output before link, default is 'Tagged With: '), | |
* sep (separator string between tags, default is ', '). | |
* | |
* Output passes through 'genesis_post_categories_shortcode' filter before returning. |
This file contains 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 | |
/* | |
* This solution assumes you've already set up your site so that the site domain is | |
* your "normal" (non-mobile) domain, and your theme is your non-mobile theme. | |
* | |
* In short, what it does it check to see if the site is being accessed through the | |
* mobile domain. If it is, the mobile theme is used instead of the normal theme, and | |
* all links point to the mobile domain (so navigatiion doesn't take visitors to the | |
* regular domain. |
This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |