Opened 11 years ago
Closed 10 years ago
#27944 closed enhancement (fixed)
Allow Native Styling of Comment Authors' Names in the .widget_recent_comments Widget
Reported by: | EMG | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 4.0 | Priority: | normal |
Severity: | normal | Version: | 2.2 |
Component: | Widgets | Keywords: | good-first-bug has-patch commit |
Focuses: | Cc: |
Description
As it currently stands, WP's native Recent Comments widget (.widget_recent_comments
) which displays a list of the most Recent Comments allows CSS styling of the Comment Author (for example, bolding)... but only in an indirect manner.
If and only if the Comment Author has a website linked to them, stylization is made possible by targeting the .url
class found in the site link associated with the Author, hence, 'indirect manner'.
Unfortunately, if the Comment Author has no website linked to them, then there is no native stylization option possible to style the Comment Author's name with without styling the entire comment listing via the .recentcomments
class.
I know I could maybe write a function or install other plugins to give me more control over such a thing, but it would be nice if WP itself offered it as a default option.
A span tag around Comment Author's names, maybe, to allow direct style targeting regardless if the Comment Author has a linked website or not?
Thank you!
Attachments (3)
Change History (18)
#2
@
11 years ago
Wow, that was quick! :)
I'm currently stuck on a legacy machine running XP with not much space left and not much memory and so I don't have a localhost install of WordPress (yet) for me to do a good test with. Going to try to clean up my machine a bit and set up a proper testing environment so I can apply the patch and report back.
Thanks!
#3
follow-up:
↓ 5
@
11 years ago
- Milestone changed from Awaiting Review to 4.0
I propose is to use <span class="comment-author"></span>
here. The cite element is not the correct element for this, see #24522 for background.
#4
@
11 years ago
I've wrapped the get_comment_author_link() in a span with class like ocean90 proposed.
#5
in reply to:
↑ 3
@
11 years ago
Replying to ocean90:
I propose is to use
<span class="comment-author"></span>
here. The cite element is not the correct element for this, see #24522 for background.
In working with theme development from the ground up and using nothing but WordPress' own natively outputted widgets, I also noticed that the .widget_rss
also outputs the author's name of an RSSed post/article/whatever wrapped in the <cite>
tag as opposed to your suggested <span class="comment-author">
.
As such, I created #28188 to address this issue. :)
This ticket was mentioned in IRC in #wordpress-dev by helen. View the logs.
10 years ago
#8
@
10 years ago
.comment-author
is likely to interfere with the existing class in comments and HTML5 comments. It might break visual back compat in themes that don't have .comment-author
selectors "namespaced" to comments themselves.
We should probably try to come up with either a (better) different class name, or another way to achieve the same result.
#9
@
10 years ago
27944.2.patch uses .comment-author-link
#11
follow-up:
↓ 12
@
10 years ago
It's more specific than .comment-author
, but it's not always a comment author link. If there is no URL, it's just the comment author's name.
Is there a way to scan the .org theme repository for that class name?
While there is only one theme on wp.com that uses comment-author-link
, I suspect that there might be other themes using it in the context of comment_author_link()
.
#12
in reply to:
↑ 11
@
10 years ago
Replying to obenland:
Is there a way to scan the .org theme repository for that class name?
I've found 4 instances of .comment-author-link
:
accelerate/style.css radiate/style.css spacious/style.css suffusion/style.css
And 1325 instances of .comment-author
.
#13
@
10 years ago
Thanks Sergey!
While Suffusion alone has over 1,000,000 downloads, the styles associated with .comment-author-link
should not be too big of a drawback:
.comment-author-link { padding: 0 0 5px 0; }
The other themes have it namespaced to the comments area.
No objections to 27944.2.patch then.
Wrapping author name in cite tag