Last active
August 29, 2015 14:09
-
-
Save jeffgreendesign/dc4eedc4afcffee9fae0 to your computer and use it in GitHub Desktop.
Common WooCommerce Code
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 | |
// Common WooCommerce Functions | |
// Enable WooCommerce support | |
add_theme_support( 'woocommerce' ); | |
// Disable WooCommerce CSS | |
add_filter( 'woocommerce_enqueue_styles', '__return_false' ); | |
// Change number or products per row to 3 | |
// http://docs.woothemes.com/document/change-number-of-products-per-row/ | |
add_filter('loop_shop_columns', 'loop_columns'); | |
if (!function_exists('loop_columns')) { | |
function loop_columns() { | |
return 3; // 3 products per row | |
} | |
} | |
// Display 24 products per page. Goes in functions.php | |
// http://docs.woothemes.com/document/change-number-of-products-displayed-per-page/ | |
add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 9;' ), 20 ); | |
// Change the breadcrumb separator | |
// http://docs.woothemes.com/document/customise-the-woocommerce-breadcrumb/ | |
add_filter( 'woocommerce_breadcrumb_defaults', 'jk_change_breadcrumb_delimiter' ); | |
function jk_change_breadcrumb_delimiter( $defaults ) { | |
// Change the breadcrumb delimeter from '/' to '>' | |
$defaults['delimiter'] = ' > '; | |
return $defaults; | |
} | |
?> | |
<!-- Common WooCommerce Code --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment