The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

WP Biographia
[resolved] Change Author Image Size from 100X100 to 100X85 (4 posts)

  1. valeryvie
    Posted 3 years ago #

    Hi :-)

    Is there a way to change the author image size from square to landscape? Instead of 100 X 100 to 100 X 86?

    Instead of square images, we use landscape... and so it 'warps' the image trying to fit it into the square shape.

    Thanks and thrive!

    Valery ~


  2. valeryvie
    Posted 3 years ago #

  3. vicchi
    Plugin Author

    Posted 3 years ago #


    I'm afraid this isn't a simple or trivial issue to solve. WP Biographia relies on the underlying WordPress avatar implementation, which in turn, uses (in order of priority) a plugged (overridden) version of the get_avatar WordPress API call, a Gravatar keyed on the user's email address, or one of the stock WordPress avatar icons.

    Regardless of which icon is used and where it originates from, the WordPress get_avatar API only supports a single size parameter (see http://codex.wordpress.org/Function_Reference/get_avatar); in other words, WordPress assumes that the height and width of an avatar image will be the same. To put it another, simpler, way; WordPress only supports square icons.

    If you're comfortable with writing PHP code and with the way in which WordPress hooks work, you could possibly write a custom get_avatar filter function (http://adambrown.info/p/wp_hooks/hook/get_avatar) which would parse the HTML img tag that emits the user's avatar and override the height and width attributes. You'd need to either ensure that all your user's avatars are the same size or be clever and detect when a non square avatar is being used and that that avatar is for one of your users and also ensure that the filter code is only being invoked within the context of WP Biographia to avoid overriding avatars for comments. You may also need to write some custom CSS to override the plugin's (entirely valid) assumption that avatars are square, depending on your current theme and/or other installed plugins.

    Note that I say you could possibly write a custom filter. I haven't tried to do this and I expect this won't be trivial to do I'm afraid.


  4. vicchi
    Plugin Author

    Posted 3 years ago #

    Haven't heard back in over 2 weeks on this so I'm assuming you've sorted the problem and I'm marking this thread as resolved; feel free to reopen it if that's not the case.


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Biographia
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic