Various sizes
-
Hello,
Can you add support for various sizes? Currently it always loads the same, and when more sizes are used on other pages, it is small and pixelated…
Thanks.
The page I need help with: [log in to see the link]
-
Hi,
as i can see here as example
https://www.etapainfantil.com/limita-comportamiento-permite-sentimientos
the plugin recognize the right size 75x75px for your theme. You can see this in the html code where width and height are 75. But the image itself has only 38×38The srcset seems only to be scaled from the 38×38 picture:
https://www.etapainfantil.com/wp-content/uploads/gravatar-cache/338f4345de7989a5816a3128179e2d0dat_2x.pngAt
https://www.etapainfantil.com/author/mariajoseroldan
the picture has only a size 24×24 but the recommended width and height 75The plugin checks the recommended size from the parameter “avatar_size” in different themefiles. You can check if there is 75 in your theme.
Are the pictures served form your webspace or from gravatar or another external ressource when you deactivate the plugin?
Best regards,
HarryThanks for your answer.
In author it is like this:
get_avatar( get_the_author_meta( 'ID' ), 75 );
And in comments like this:
wp_list_comments( array( 'callback' => 't_comment' , 'avatar_size' => 48 ) );
If I deactivate the plugin it loads from Gravatar.
In the plugin settings it is set to 48px per template.
What can be wrong?
Thanks.
- This reply was modified 3 years, 7 months ago by etapainfantil.com.
Ok, can you let the plugin deactivate for a while, so i can check something?
I am seeing and in the article loads this image:
https://www.etapainfantil.com/wp-content/uploads/gravatar-cache/338f4345de7989a5816a3128179e2d0dat.pngAnd on the author page, this one:
https://www.etapainfantil.com/wp-content/uploads/gravatar-cache/338f4345de7989a5816a3128179e2d0d.pngI don’t understand why the exact same function loads a different cached image depending on the page.
get_avatar( get_the_author_meta( 'ID' ), 75 );
Of course, I have already disabled it.
Thanks.
The different images comes because the author image and a commentor image has/become different ids. The “at” in the filename is for “author”;)
Ok, 75 should be the right size for both, author and comments, and is correctly served from gravatar.
It seems the 48 from the comments is not recognized from gravatar/jetpack.
Or the function is not used dor normal comments and is only used in an overview or a sidebar like on my site:
https://www.all4hardware4u.de/elektronik-news/Is the theme up to date?
Can you give me the filnames and relativ path from /wp-content/themes/ where
get_avatar( get_the_author_meta( 'ID' ), 75 );
and
wp_list_comments( array( 'callback' => 't_comment' , 'avatar_size' => 48 ) );
are in?So have you try to clear the cache from the plugin?
After clearing open the url without being logged in as an admin (maybe use just another browser) to rebuild the cache.
The cached files should have the dimension 75×75 after clearing und rebuild.The theme is our own and the function we use on both sites is the same:
get_avatar (get_the_author_meta ('ID'), 75);
You can see all the cases here. I don’t understand why it loads different images.
https://www.etapainfantil.com/hijo-pide-agua-cuando-esta-cama
https://www.etapainfantil.com/author/mariajoseroldan
https://www.etapainfantil.com/hijo-pide-agua-cuando-esta-cama#commentsI already tried a long time ago and if I delete the cache and access the page where the largest is loaded, the largest is left in the cache. But when cache is cleared, it can load any one (and many times it is the small one).
Ok, the plugin looks in various files for “avatar_size” and “get_avatar” in the theme-files.
Can you check in the main file of the plugin at line 223 and following if your files are in the relative path for the check?Sorry, I don’t understand what you mean. What do you need exactly?
Right now the plugin is deactivated, you can see what is loaded in each case. Anyway, as I mentioned in article author and author page, I use the same function but load different images.
Are you able to check in the sourcecode from harrys-gravatar-cache.php if your files from your theme are in the array for the search routine? It begins at line 223 to 234
These files (if they exist) from the theme in the paths “get_template_directory()” and “get_stylesheet_directory()” are checked for the avatar-sizes:
/functions.php
/lib/functions/template-comments.php
/single.php
/comments.php
/includes/functions/comments.php
/includes/meta.phpAre your “get_avatar( get_the_author_meta( ‘ID’ ), 75 );” and
wp_list_comments( array( 'callback' => 't_comment' , 'avatar_size' => 48 ) );
in one of these files?I think the file that it finds with some of those functions is “comments.php”:
wp_list_comments (array ('callback' => 'bambino_comment', 'avatar_size' => 48));
Maybe this is the problem, the first one it finds and generates is this of 48, if it took “content-single.php” it would work because it would take 75.
How can I add “content-single.php” at the beginning?
- This reply was modified 3 years, 7 months ago by etapainfantil.com.
- This reply was modified 3 years, 7 months ago by etapainfantil.com.
You can just add the two lines at 223 and 234(235 after adding the first line), just copy and paste the lines before and replace the php file with your file.
You mean add it directly to the plugin’s “harrys-gravatar-cache.php” file for testing?
Yes
just keep a backup from the file if something is wrong;)
if it will work, i can make an update.I have put that, I have added 75 in the plugin config and the author takes it but for some strange reason, it adds 75px in the comments avatar although in get_avatar it forces 48. Can you think of where you are changing? I’ve been modifying even the get_avatar function to test and then in HTML it says 48.
- The topic ‘Various sizes’ is closed to new replies.