Created
December 7, 2015 14:23
-
-
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.
This file contains hidden or 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 | |
/** | |
* 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