David, This is some excellent code for adding some microformats to @WordPress. Thanks @dshanske! https://david.shanske.com/2016/06/22/converting-wordpress-themes-microformats-2-part-1
For those with less technical expertise, could I pose a few questions which you may or may not cover in part 2?
If I recall, there’s microformats version 1 and a more recent, updated microformats2. Most of what you’re adding here is the mf2 spec and not backwards compatible mf1 mark up, right?
When you say that a theme shouldn’t “style” hfeed or hentry, you mean that the CSS shouldn’t include these classes as they’re used only for semantic mark up and not meant to be used for CSS at all?
If hfeed is already added into a theme, do you recommend removing it from the theme code directly with search and replace (particularly if it wasn’t added in the correct place) and then adding it with the snippet you provided, or is it best to leave it in the theme and remove it from the code? If we remove it from the code you provided, which line(s) should we omit? What happens if it is duplicated (ie, what will the output look like, or what happens to parsers that read the code)?
What exactly are the post, body and comment class functions? What do they look like and where would one find them in a particular theme?
How is the code you’ve provided different from what the WordPress plugin uf2 does? Is it more or less extensive?
In the end, this is also just a stop-gap measure to quickly add a small, but high level subset of microformats to current themes that don’t support it? Ideally we would hope more modern themes will add a more full version of microformats natively?