Skip to content

Instantly share code, notes, and snippets.

@KnowTheCodePro
Created April 10, 2016 23:30
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 KnowTheCodePro/f9f5144bc2d527baf30a0167b9871f44 to your computer and use it in GitHub Desktop.
Save KnowTheCodePro/f9f5144bc2d527baf30a0167b9871f44 to your computer and use it in GitHub Desktop.
Adding a post ID data attribute to genesis_attr_entry
<?php
namespace KnowTheCode;
add_filter( 'genesis_attr_entry', __NAMESPACE__ . '\change_entry_attributes', 99 );
function change_entry_attributes( $attributes ) {
d( $attributes );
$attributes['data-post-id'] = get_the_ID();
d( $attributes );
return $attributes;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment