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'; }