Last active
November 7, 2017 03:52
-
-
Save rfmeier/fd958478a89849f85fafc3ee95f9f1a0 to your computer and use it in GitHub Desktop.
Display full content width for a single woocommerce product in Genesis
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 | |
add_filter( 'genesis_site_layout', 'sample_genesis_site_layout' ); | |
/** | |
* Callback for 'genesis_site_layout' filter. | |
* | |
* Force full width content on the single product page. | |
* | |
* @param $layout The layout slug. | |
* @return string The layout slug. | |
*/ | |
function sample_genesis_site_layout( $layout ) { | |
// if a singular product page, set the new layout | |
if ( ! is_archive() && 'product' === get_post_type() ) { | |
$layout = 'full-width-content'; | |
} | |
return $layout; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment