3rd Sized Avatar
Disclaimer: I know just enough to get me in trouble ( to whitescreen my site? LOL) I know to put some ‘things’ in some ‘places’ but I don’t know why. On the road to website optimization, gtmetrix.com told me to send ‘scaled’ images to my pages and one of the un-scaled cuprits? Avatars. Full and thumb avatars are being downsized to teeny tiny avatars. At this point, with only my five website users, it’s not such a big deal, but when I get miiiyyons of followers?!? (LOL *sarcasm*) Five long days later, trudging through many many website with the glimmer of hope tarnishing to dust, and while I’ve learned a lot, I’m gonna cheat now and ask for the answer… LOL At least I’ll understand the answer better? I hope? LOL
So, on to the issue…
I’m trying to get, and use a 3rd sized avatar. By copy-past-edit, I’ve been able to actually create that third size of avatar, cropped, which I call ‘tinythumb’. So in an individual user’s avatar folder, there are 3 avatars sized ‘full’, ‘thumb’ and ‘tinythumb’. Yaay, me!
My issue is that I cannot figure out how to call it into action. I’ve used bp_member_avatar(‘type=tinythumb&width=20&height=20′) in the appropriate spot of my widgets and pages but it doesn’t show up unless I change the “type” from “full” to “tinythumb” down below. But then ALL my pics are being served from a “tinythumb” and upscaled all pixelated.
On line 375 in bp-core-avatars.php, there is a phrase that says:
- ORIGINAL: $avatar_size = ( ‘full’ == $type ) ? ‘-bpfull’ : ‘-bpthumb';
If I put in ‘-bptinythumb’ in that line, I get the white screen of syntax error death. By trial and error, edit-upload-edit-reupload, it says there is an error with ‘:’ or the “;” or if I try to use a comma, “,”.
ERROR: $avatar_size = ( ‘full’ == $type ) ? ‘-bpfull’ : ‘-bpthumb’ : ‘-bptinythumb’;
ERROR: $avatar_size = ( ‘full’ == $type ) ? ‘-bpfull’, ‘-bpthumb’ , ‘-bptinythumb’;
ERROR: $avatar_size = ( ‘full’ == $type ) ? ‘-bpfull'; ‘-bpthumb’ ; ‘-bptinythumb’;
If I change the ( ‘full’ == $type ) to ( ‘tinythumb’ == $type ), I get a teeny tiny avatar blown up, blurry and pixilated so I know that it can ‘see’ the ‘tinythumb’ avatar, I just can’t get it into the second part of the phrase. Either somewhere it is telling wordpress or buddypress to only ‘look’ for two options OR, because I don’t know how to code (BIG understatement! LOL) I’m not putting it in the correct format.
Also, I’m not sure if I haven’t explained to the code, the ‘–bp’ part of the ‘–bptinythumb’ so that might be the issue but I can’t tell because I don’t know where to tell it to do that.
How do I get it to ‘see’ the ‘tinythumb’ avatar and use it? Is there an easier and better way?
(Dear god make it so…:) ) Hopefully someone better than me will get to the heart of this and point me in the right direction. Thanks so much!
http://delightfulhorse.com in case you want to see the site in question. If you see a white screen, it’s cuz I’m messing with stuff. Give it a minute and I’ll be re-uploading the original. Unless my internet goes out… (the horror!) LOL
- The topic ‘3rd Sized Avatar’ is closed to new replies.