Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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