Add class "has-post-thumbnail" to body element


since there is no conditional logic built in, it would be nice to know, if the post or page has a featured image to show or hide elements at least via css, which would make a lot things easier (eg a post header with the featured image in the background).

This would also grant the possibility to have different post layouts for posts with or without featured images.

I know i can use a child theme and simply add a function that adds the class, but most of the time a child theme isn´t necessary.

Another option would be a “has post thumbnail” condition in the template conditions, so you can create two “post-header” templates conditionally.

Let me know what you think.