Avatar size in bbPress

Posted in: Newsmag
Post count: 32

Hey tagDiv folks!

Having a slight problem with bbPress. And yes, I know this is my fault.

When I themed bbPress before, I changed the size of the avatar I was grabbing from the Gravatar service to 14 px. But, now that I have your new bbPress functionality (which looks a hell of a lot better than the theming I was trying to do) that uses a 40 px avatar on the forum index, my 14 px avatar is now getting stretched.

Do you know where in my code might be the variable that defines the size of the avatar requested from Gravatar?

Cheers,
Mark

Screenshot

Post count: 9544

I think that’s all handled in the bbPress code, not in the theme.

Likely a post on the bbPress forum might get quicker answer this weekend.

Post count: 32

I’m not in a rush so it’s no big deal.

Post count: 9544

Not sure this helps or not …

e.g., bbPress forum
https://bbpress.org/forums/topic-tag/avatar-size/

maybe the trick used from there, to set
BP_AVATAR_THUMB_WIDTH in functions.php to desired size.

I’m sure though that Lucian or Marius will have muuuuuuch better answer 🙂
Just food for thought.

  • This reply was modified 11 years by simchris.
  • This reply was modified 11 years by simchris.
  • This reply was modified 11 years by simchris.
Post count: 32

BP_ parameters are for BuddyPress, not bbPress.

I’ve already gone through the forum and I did find an answer before when I was working on this issue before (when I made it smaller). But, for the life of me, I cannot find it again.

Posting to a forum is usually my last resort. Also, I post here so that other people using the same theme can see the thread.

Post count: 9544

Heh. Stupid me, you are correct.
I will quietly shut up at this point 🙂

Post count: 6600

Hi,

Bbpress plugin by default gets the 14px avatar size so you need to rewrite this within bbpres files and try to find a hook for this or you can use a plugin like WP User Avatar

Thanks

Post count: 32

Hi Lucian,

I’ll definitely use the plugin instead!

Thanks for the help (yet again).

Cheers,
Mark

Post count: 32

Hey,

After a little more digging, I think this should be called a bug.

If bbPress is truly supported by the theme, theme buyers shouldn’t have to do more customization in order for it to look as it should.

I did find one topic on the bbPress forums: https://bbpress.org/forums/topic/change-avatar-size/

Basically, in order to make the thumbnail itself bigger, we need the thumbnail to be defined in a template file as part of the main theme install. Since editing core files is a no-no (from a bbPress and theme perspective due to updates), the only way you can fix this (it seems, please correct me if I’m wrong) is to install the Newsmag-child theme, add the different bbPress template files, and edited the values in those newly copied template files.

Post count: 32

Found a solution…

I installed the Newsmag-child theme and copied two files from the bbPress installation into the child theme:

  • loop-single-topic.php
  • loop-single-forum.php

Both of these files can be found in wp-content/plugins/bbpress/templates/default/bbpress.

Paste both files into wp-content/themes/[child_theme_dir] where child_theme_dir = directory of your child theme, usually Newsmag-child unless you’ve made changes to the name of the theme.

In these two files are multiple references to size => 14.

  • bbp_get_topic_author_link function handles the avatars under the “Author” column (left-most column in forum index views).
  • bbp_get_topic_last_active_id function handles the avatars under the “Fressness” column (right-most column in forum index views).

I am sure there are more times when avatar sizes are being set by bbPress (and I will post them as I find them when I go through and do some cleanup). But, the best way to find them on your own is do a search for the CSS container for the avatar (ex: bbp-topic-freshness-author) in the bbPress template files. Once you find the template file, copy it over to the child theme and make your edits.

Pretty simple once you figure it out!

Post count: 6600

Hi,

Glad you have managed to figure this out! I have also added this on our todo list so we will take a look at it and test it and try to implement it in future updates.

Thanks for the message!

Viewing 11 posts - 1 through 11 (of 11 total)
The forum ‘Newsmag’ is closed to new topics and replies.