Skip to content

Instantly share code, notes, and snippets.

@rfmeier
Last active November 7, 2017 03:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rfmeier/fd958478a89849f85fafc3ee95f9f1a0 to your computer and use it in GitHub Desktop.
Save rfmeier/fd958478a89849f85fafc3ee95f9f1a0 to your computer and use it in GitHub Desktop.
Display full content width for a single woocommerce product in Genesis
<?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