Looking to force full content layout to all WooCommerce product category archives, WooCommerce product tag archives and single product pages in your Genesis site?
Just add the following code in your child theme’s functions.php:
// Force full content layout on product category, product tag archives and all single products
add_action( 'get_header', 'sk_force_layout' );
function sk_force_layout() {
if ( is_tax( 'product_cat' ) || is_tax( 'product_tag' ) || is_singular( 'product' ) ) {
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
}
}
Full content layout for the main shop page, cart and checkout pages can be set by simply editing those static Pages and applying the layout.
Hello Sridhar,
Thank you for all these great tutorials.
I’ve been trying to widen my WooCommerce product page content area in my Altitude Pro theme with no luck.
When I activate the “Genesis Connect For Woocommerce” plugin the WooCommerce Product Page width narrows to 800 px which is way too narrow for my needs.
When I deactivate the “Genesis Connect For Woocommerce” plugin the WooCommerce Product Page width increases to 1200 px which is ideal however, the primary sidebar widget drops into the lower right product page content area.
I added your code to my functions.php;
// Force full content layout on product category, product tag archives and all single products
add_action( ‘get_header’, ‘sk_force_layout’ );
function sk_force_layout() {
if ( is_tax( ‘product_cat’ ) || is_tax( ‘product_tag’ ) || is_singular( ‘product’ ) ) {
add_filter( ‘genesis_pre_get_option_site_layout’, ‘__genesis_return_full_width_content’ );
}
}
however, nothing changed – the width did not increase when I activated or deactivated the “Genesis Connect For Woocommerce” plugin.
I have 2 Questions;
1. What CSS tweaks can I add to my styles.css to increase the WooCommerce Product Page width from 800 px to 1200 px with the Genesis Connect For Woocommerce” plugin activated?
2. How can I also get the // Force full content layout on product category, product tag archives and all single products to work?
Thanks in advance for your help.