Opened 4 months ago
Closed 2 months ago
#23128 closed defect (bug) (fixed)
Twenty Twelve: "Post Author" included as hCard names in comments
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 3.6 |
| Component: | Bundled Theme | Version: | 3.5 |
| Severity: | normal | Keywords: | has-patch needs-testing |
| Cc: |
Description
When Twenty Twelve output comments made by the author of the post being viewed, it appends "Post Author" (wrapped in a SPAN) to the comment author's name.
The problem is that the entire thing (author's name & "Post Author") is wrapped in a CITE with hCard class "fn" applied to it.
This causes hCard parsers to consider "Post Author" to be part of the author's full name, as can be verified by parse results here (http://www.google.com/webmasters/tools/richsnippets) when running through Twenty Twelve-powered posts with comments made by the post author.
Line 289 of Twenty Twelve's functions.php is the relevant line; moving "%2$s" to outside the CITE tag is all that's needed, at least to fix the semantics problem (not sure if there's specific styling attached to the SPAN within the CITE or not).
Attachments (3)
Change History (16)
comment:1
SergeyBiryukov — 4 months ago
- Component changed from Themes to Bundled Theme
- Keywords has-patch needs-testing added
- Milestone changed from Awaiting Review to 3.6
- Severity changed from trivial to normal
comment:3
BrazenlyGeek — 4 months ago
Could that be simplified by then removing the SPAN surrounding "post author"?
Instead of this:
SPAN CITE name /CITE SPAN post author /SPAN /SPAN
We'd then have this:
SPAN CITE name /CITE post author /SPAN
(Specifically, I mean removing the SPAN tags from line 292, as the remaining SPAN & CITE tags in the above patch ought to be enough to style the whole phrase [name + "post author"] as needed.)
Hm, I don't think this is really possible. We need some kind of markup to be able to style the badge.
My concerns were more about the fact that we use the tag itself (instead of a class for example) to style it and my diff introduces a second element of the same kind. We also could introduce and use a class to style it, I'm just not sure how that would affect backwards compatibility.
comment:5
BrazenlyGeek — 4 months ago
Can the outer SPAN itself be removed? So instead we have this:
CITE name /CITE SPAN post author /SPAN
I'm by no means a designer so I'm unsure how that affects the design aspect of it, but the idea of nesting non-semantic SPANs seems a bit much.
comment:7
SergeyBiryukov — 3 months ago
- Summary changed from "Post Author" included as hCard names in Twenty Twelve comments to Twenty Twelve: "Post Author" included as hCard names in comments
comment:8
lancewillett — 3 months ago
This relates a bit to #20088 -- if we retrofit Twenty Twelve to use core markup (and not its own custom callback) this ticket will be obsolete.
comment:9
lancewillett — 2 months ago
The change in markup could break child theme styles (or sites using Custom CSS on WP.com) that have styled the post author text -- or hidden it, right?
comment:10
in reply to:
↑ 6
lancewillett — 2 months ago
Replying to nacin:
Or we just remove the badge.
We can't remove the badge since the theme has no other visual indicator of a post author's comments.
comment:11
lancewillett — 2 months ago
.2 patch uses an HTML-only technique to make the markup more specific without changing CSS at all. Should work perfectly for back compat, no changes needed to child theme CSS.
lancewillett — 2 months ago
comment:12
obenland — 2 months ago
Wow, nice patch!
lancewillett — 2 months ago
comment:13
lancewillett — 2 months ago
- Owner set to lancewillett
- Resolution set to fixed
- Status changed from new to closed
In 23716:

Wrapping it in another span made the most sense to me - might not be the best solution.