Filter post style attribute
Looking for a hook which enables filtering of a class within the post or content so i can add inline CSS using custom fields for posts on the home page.
Something like this -
add_filter( 'attr_entry', 'filter_post_html_tag' );
function filter_post_html_tag( $attributes ) {
$color = get_post_meta( get_the_ID(), 'background_color', true );
$colors = $color ? $color : 'grey';
$attributes['style'] = 'color:' . $colors . '';
return $attributes;
}
Topic the-content css custom-field Wordpress
Category Web