From ac4ab9cd605d5eac9675562fafdb2b03a7c48247 Mon Sep 17 00:00:00 2001 From: Lance Willett Date: Wed, 27 Feb 2013 04:25:14 +0000 Subject: [PATCH] Twenty Thirteen: style comments correctly when `show_avatars` option is turned off in Discussion settings. Props SriniG, fixes #23558. git-svn-id: https://develop.svn.wordpress.org/trunk@23498 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-content/themes/twentythirteen/functions.php | 17 +++++++++++++++++ wp-content/themes/twentythirteen/style.css | 12 ++++++++++++ 2 files changed, 29 insertions(+) diff --git a/wp-content/themes/twentythirteen/functions.php b/wp-content/themes/twentythirteen/functions.php index 295d9e23d9..0c13d6afd9 100644 --- a/wp-content/themes/twentythirteen/functions.php +++ b/wp-content/themes/twentythirteen/functions.php @@ -512,6 +512,23 @@ function twentythirteen_body_class( $classes ) { } add_filter( 'body_class', 'twentythirteen_body_class' ); +/** + * Extends the default WordPress comment class to add 'no-avatars' class + * if avatars are disabled in discussion settings. + * + * @since Twenty Thirteen 1.0 + * + * @param array $classes Existing class values. + * @return array Filtered class values. + */ +function twentythirteen_comment_class( $classes ) { + if ( ! get_option ( 'show_avatars' ) ) + $classes[] = 'no-avatars'; + + return $classes; +} +add_filter( 'comment_class', 'twentythirteen_comment_class' ); + /** * Adjusts content_width value for image post formats, video post formats, and * image attachment templates. diff --git a/wp-content/themes/twentythirteen/style.css b/wp-content/themes/twentythirteen/style.css index 0a778706e9..e217f5ae48 100644 --- a/wp-content/themes/twentythirteen/style.css +++ b/wp-content/themes/twentythirteen/style.css @@ -2244,6 +2244,18 @@ footer.entry-meta { font-style: normal; } +.no-avatars .comment-author { + float: none; + margin: 0 0 5px; + max-width: 100%; +} + +.no-avatars .comment-meta, +.no-avatars .comment-content, +.no-avatars .reply { + width: 100%; +} + .bypostauthor .fn:before { content: '\f408'; }