Skip to content

Instantly share code, notes, and snippets.

@SiGaCode
Created March 15, 2015 18:21
Show Gist options
  • Save SiGaCode/8cb8fb918f259eb65a45 to your computer and use it in GitHub Desktop.
Save SiGaCode/8cb8fb918f259eb65a45 to your computer and use it in GitHub Desktop.
Custom body attributes (change filter to apply to any other element) Credits: http://wpbeaches.com/adding-attribute-html-section-genesis/
add_filter( 'genesis_attr_body', 'custom_add_css_attr' );
function custom_add_css_attr( $attributes ) {
// add original plus extra CSS classes
$attributes['class'] .= ' parallax';
$attributes['data-diff'] = '100';
// return the attributes
return $attributes;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment