From: Laury GvR Date: Tue, 14 Aug 2018 18:53:35 +0000 (-0400) Subject: Reduce related products to 3, don't show uncategorized cat in sidebar X-Git-Tag: v1.0.18^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=af81facb36bf9ed03f954dfab499f12d2e76c1c1;p=WP-Themes%2Fturkeyville.git Reduce related products to 3, don't show uncategorized cat in sidebar --- diff --git a/functions.php b/functions.php index c30e5a7..b1dea8c 100644 --- a/functions.php +++ b/functions.php @@ -153,11 +153,28 @@ function is_post_type($type){ add_action('thematic_searchloop', 'mytheme_search_loop'); // End of the Contextual/Highlight Search functions +// declare Woocommerce support add_action( 'after_setup_theme', 'woocommerce_support' ); function woocommerce_support() { add_theme_support( 'woocommerce' ); } +/** + * Change number of related products output + */ +function woo_related_products_limit() { + global $product; + + $args['posts_per_page'] = 3; + return $args; + } + add_filter( 'woocommerce_output_related_products_args', 'related_products_args' ); + function related_products_args( $args ) { + $args['posts_per_page'] = 3; // 4 related products + $args['columns'] = 3; // arranged in 2 columns + return $args; + } + // The GLM Simple Messageboard needs this function to display its data if ( !function_exists( 'glm_get_simplemessageboard_option' ) ) { function glm_get_simplemessageboard_option( $option_name ) diff --git a/parts/shop-cats-and-products.php b/parts/shop-cats-and-products.php index d8ee7e7..963887f 100644 --- a/parts/shop-cats-and-products.php +++ b/parts/shop-cats-and-products.php @@ -33,7 +33,8 @@ 'orderby' => 'title', 'order' => 'ASC', 'hide_empty' => false, - 'parent' => 0 + 'parent' => 0, + 'exclude' => 134 ); $categories = get_terms( 'product_cat', $cat_args ); $count = count($categories); diff --git a/style.css b/style.css index 22c68b1..baebd9a 100644 --- a/style.css +++ b/style.css @@ -3,5 +3,5 @@ Theme Name: CornwellsTurkeyville Author: Gaslight Media Author URI: http://www.gaslightmedia.com Description: A theme for CornwellsTurkeyville -Version: 1.0.17 +Version: 1.0.18 */