Skip to content

Instantly share code, notes, and snippets.

@secretstache
Created July 28, 2016 16:48
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 secretstache/89296db426561bea2176e1ba02b5224e to your computer and use it in GitHub Desktop.
Save secretstache/89296db426561bea2176e1ba02b5224e to your computer and use it in GitHub Desktop.
data attributes for genesis
add_filter( 'genesis_attr_site-container', 'ssm_data_off_canvas_content' );
function ssm_data_off_canvas_content($attributes) {
$attributes['data'] = 'data-off-canvas-content';
return $attributes;
}
// this creates <div class="site-container" data='data-off-canvas-content'></div>
// is there a way to do something like <div class="site-container" data-off-canvas-content></div>
@secretstache
Copy link
Author

secretstache commented Jul 28, 2016

ok, I'll answer my own question:

$attributes['data-off-canvas-content'] = 'data-off-canvas-content';

actually works, albeit inelegant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment