Code Snippet

Home » Code Snippets » WordPress » Change Avatar Size

Change Avatar Size

The wp_list_comments function has a parameter to change the default (48px) size to anywhere between 0 and 80px.

wp_list_comments('avatar_size=80');

Subscribe to The Thread

  1. Though you may use css for that.

  2. CSS is going to scale the img, which will pixelate it. This technique fetches an img sized the way you want it, which is the better way to go.

  3. I wish I’d found this site before, there is great information. I was looking for this code

  4. Jonas

    Ahh.. so easy… why didn’t i get this two weeks earlier :)

  5. Marcus

    Where does this go? In CSS? In comments.php? Somewhere else?

    • You would place this in the function that is displaying your comments. (In comments.php)
      Example:

      
      		<ol class="commentlist">
      			<?php wp_list_comments('avatar_size=70&type=comment'); ?>
      		</ol>
      

      Good luck!

  6. YO MOMMA

    Will this work with .comments TD?

  7. datta

    how i can change align of my avatars

  8. I spent so much time trying to figure the resize out. Thank you for your help, Josh!

Speak, my friend

At this moment, you have an awesome opportunity* to be the person your mother always wanted you to be: kind, helpful, and smart. Do that, and we'll give you a big ol' gold star for the day (literally).

Posting tips:
  • You can use basic HTML
  • When posting code, please turn all
    < characters into &lt;
  • If the code is multi-line, use
    <pre><code></code></pre>
Thank you,
~ The Management ~