Skip to content

Instantly share code, notes, and snippets.

@topleague
Last active December 3, 2019 07:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save topleague/0ad00439e490c73dcacb768a313b942e to your computer and use it in GitHub Desktop.
Save topleague/0ad00439e490c73dcacb768a313b942e to your computer and use it in GitHub Desktop.
Adding Classes and Attributes to HTML elements in Genesis
// Adding Classes and Attributes to HTML elements in Genesis
// Courtesy: https://wpbeaches.com/adding-attribute-html-section-genesis/
//* Add class to .entry
add_filter( 'genesis_attr_entry', 'susanta_animate_entry' );
function susanta_animate_entry( $attributes ) {
$attributes['class'] = $attributes['class']. ' animate-entry fadeUp';
return $attributes;
}
//* Add class to .sidebar-wrap
add_filter( 'genesis_attr_content-sidebar-wrap', 'susanta_animate_sidebar_wrap' );
function susanta_animate_sidebar_wrap( $attributes ) {
$attributes['class'] = $attributes['class']. ' animate-sidebar-wrap fadeUp';
return $attributes;
}
//* Add class to .entry-content
add_filter( 'genesis_attr_entry-content', 'susanta_animate_entry_content' );
function susanta_animate_entry_content( $attributes ) {
$attributes['class'] = $attributes['class']. ' animate-entry-content fadeUp';
return $attributes;
}
//* Add class to .site-inner
add_filter('genesis_attr_site-inner', 'susanta_animate_site_inner');
function susanta_animate_site_inner($attributes) {
$attributes['class'] = $attributes['class']. ' animate-site-inner fadeUp';
return $attributes;
}
//* Add class to .content
add_filter('genesis_attr_content', 'susanta_animate_content');
function susanta_animate_content($attributes) {
$attributes['class'] = $attributes['class']. ' animate-content fadeUp';
return $attributes;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment