Skip to content

Instantly share code, notes, and snippets.

@nikcree
Forked from anonymous/gist:d6a5fd2bc73cf345f175
Last active August 29, 2015 14:16
Show Gist options
  • Save nikcree/9ee6a2d66ebad75926ae to your computer and use it in GitHub Desktop.
Save nikcree/9ee6a2d66ebad75926ae to your computer and use it in GitHub Desktop.
add_filter( 'genesis_attr_content', 'custom_attributes_content' );
/**
* Add the class needed for FacetWP to main element.
*
* Context: Posts page, all Archives and Search results page.
*
* @author Sridhar Katakam
* @link http://sridharkatakam.com/facetwp-genesis/
*/
function custom_attributes_content( $attributes ) {
if ( is_home() || is_archive() || is_search() ) {
$attributes['class'] .= ' facetwp-template';
}
return $attributes;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment