Skip to content

Instantly share code, notes, and snippets.

@blogjunkie
Created December 7, 2015 14:23
Show Gist options
  • Save blogjunkie/df5784ebcc3f92c98441 to your computer and use it in GitHub Desktop.
Save blogjunkie/df5784ebcc3f92c98441 to your computer and use it in GitHub Desktop.
The Shop page is actually an archive page for the Products CPT and won't obey the layout settings for the page. This snippet fixes that.
<?php
/**
* Make WooCommerce product archive obey shop page layout settings
*/
add_filter( 'genesis_pre_get_option_site_layout', 'child_do_shop_layout' );
function child_do_shop_layout( $opt ) {
if ( is_post_type_archive('product') ) {
$opt = get_post_meta( wc_get_page_id('shop'), '_genesis_layout', true);
return $opt;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment