Skip to content

Commit

Permalink
Change rendered avatar size (#318)
Browse files Browse the repository at this point in the history
* Change rendered avatar size

Reduces the standard fetched avatar size, dependant on the format.

* Reverse image size
  • Loading branch information
pkevan authored Sep 26, 2024
1 parent 19b3897 commit 04e5480
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion themes/wporg-5ftf-2024/src/pledge-contributors/render.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@
// Initialize count to zero for untruncated view.
$count_more = 0;

// Set avatar size at smallest usage in px.
$avatar_size = 70;

if ( $is_truncated ) {
$count_more = count( $contributors ) - TRUNCATED_MAX;
$contributors = array_splice( $contributors, 0, TRUNCATED_MAX );
$avatar_size = 30;
}

?>
Expand All @@ -31,7 +35,7 @@
<li class="pledge-contributor">
<span class="pledge-contributor__avatar">
<a href="<?php echo esc_url( 'https://profiles.wordpress.org/' . $contributor->user_nicename . '/' ); ?>">
<?php echo get_avatar( $contributor->user_email, 280, 'mystery', $contributor->display_name ); ?>
<?php echo get_avatar( $contributor->user_email, $avatar_size, 'mystery', $contributor->display_name ); ?>
</a>
</span>
</li>
Expand Down

0 comments on commit 04e5480

Please sign in to comment.