Skip to content

Instantly share code, notes, and snippets.

Created December 14, 2014 06:20
Show Gist options
  • Save anonymous/d6a5fd2bc73cf345f175 to your computer and use it in GitHub Desktop.
Save anonymous/d6a5fd2bc73cf345f175 to your computer and use it in GitHub Desktop.
Genesis Functions.php for FacetWP
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