add_filter( 'genesis_attr_entry', 'custom_attributes_entry' );
/**
* Adds `data-filter` custom attribute to `.entry` element(s) with the value as space separated categories of current post.
* @param array $attributes Existing attributes.
* @return array Modified attributes.
*/
function custom_attributes_entry( $attributes ) {
$post_categories = get_the_category();
$categories_list = array();
foreach ( $post_categories as $post_category ) {
$categories_list[] = 'category-' . $post_category->slug;
}
$attributes['data-filter'] = implode( ' ', $categories_list );
return $attributes;
}