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
// Change number or products per row to 3 | |
add_filter('loop_shop_columns', 'loop_columns'); | |
if (!function_exists('loop_columns')) { | |
function loop_columns() { | |
return 3; // 3 products per row | |
} | |
} |
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_filter( 'loop_shop_per_page', 'new_loop_shop_per_page', 20 ); | |
function new_loop_shop_per_page( $cols ) { | |
// $cols contains the current number of products per page based on the value stored on Options -> Reading | |
// Return the number of products you wanna show per page. | |
$cols = 9; | |
return $cols; | |
} |
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 | |
/** | |
* Hook in on activation | |
*/ | |
/** | |
* Define image sizes | |
*/ | |
function yourtheme_woocommerce_image_dimensions() { | |
global $pagenow; |
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
if (!function_exists('woocommerce_template_single_excerpt')) { | |
function woocommerce_template_single_excerpt( $post ) { | |
global $post; | |
if ($post->post_excerpt) echo '<div itemprop="description">' . do_shortcode(wpautop(wptexturize($post->post_excerpt))) . '</div>'; | |
} | |
} |
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
/* | |
* goes in theme functions.php or a custom plugin | |
* | |
* Subject filters: | |
* woocommerce_email_subject_new_order | |
* woocommerce_email_subject_customer_processing_order | |
* woocommerce_email_subject_customer_completed_order | |
* woocommerce_email_subject_customer_invoice | |
* woocommerce_email_subject_customer_note | |
* woocommerce_email_subject_low_stock |
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 the field to order emails | |
**/ | |
add_filter('woocommerce_email_order_meta_keys', 'my_woocommerce_email_order_meta_keys'); | |
function my_woocommerce_email_order_meta_keys( $keys ) { | |
$keys['How did you hear about us?'] = 'hear_about_us'; | |
return $keys; | |
} |
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_filter ( 'woocommerce_product_thumbnails_columns', 'xx_thumb_cols' ); | |
function xx_thumb_cols() { | |
return 4; // .last class applied to every 4th thumbnail | |
} |
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
/** | |
* Code goes in functions.php or a custom plugin. | |
*/ | |
add_action( 'woocommerce_email', 'unhook_those_pesky_emails' ); | |
function unhook_those_pesky_emails( $email_class ) { | |
/** | |
* Hooks for sending emails during store events | |
**/ |
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 | |
/** | |
* WARNING! THIS SNIPPET MAY BE OUTDATED. | |
* The latest version of this snippet can be found in the Gravity Wiz Snippet Library: | |
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gw-email-domain-validator.php | |
*/ | |
/** | |
* Gravity Wiz // Gravity Forms // Email Domain Validator | |
* | |
* This snippets allows you to exclude a list of invalid domains or include a list of valid domains for your Gravity Form Email fields. |
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 | |
/** | |
* In theory should support the following subdir sites as port of a subdomain network: | |
* - subdomain.example.org/site1 | |
* - subdomain.example.org/site2 | |
*/ | |
function can_i_haz_subdomain_and_subdir() { | |
global $wpdb, $current_blog, $current_site, $blog_id, $site_id; | |
// Taken from ms-settings.php |
OlderNewer