-
AuthorPosts
-
July 30, 2024 at 2:10 pm #1463329
Hi,
I have my blog thumbnail size set as 200 pixels width x 300 pixels height in WordPress > Settings > Media Settings.
However I cannot for the life of me manage to get my website to display this size thumbnails for blog posts. Instead it is displaying either much smaller or much larger thumbnails. See https://guardingtheguards.com/category/library/garda-review/I have also tried editing my blog page to show 5 across and the correct thumbnail size here:
This is also having no impact.I would appreciate any help as to how I can get my website to display thumbnails of 200×300.
Many thanks
July 31, 2024 at 6:56 am #1463397Hey lucybb2,
Thank you for the inquiry.
Looks like you’re trying to adjust the size of the thumbnails on the archive or category pages. This cannot be adjusted in the Settings > Media panel. You have to edit the archive.php file directly or use this filter in the functions.php file:
add_filter("avf_post_slider_args", function($atts, $context) { if( $context == "archive" ) { $atts['type'] = 'grid'; $atts['columns'] = 4; $atts['preview_mode'] = 'custom'; $atts['image_size'] = 'medium'; } return $atts; }, 10, 2);
The filter above will set the image size to Medium. Also, when you change the size of the thumbnails, you need to either upload the images again or regenerate the thumbnails.
// https://wordpress.org/plugins/regenerate-thumbnails-advanced/
// https://wordpress.org/plugins/force-regenerate-thumbnails/Best regards,
IsmaelJuly 31, 2024 at 4:45 pm #1463445Thank you.
Is there maybe a typo in this code snippit. I’m only getting errors if I add it to functions.php, like
Your PHP code changes were not applied due to an error on line 14 of file wp-content/themes/enfold-child/functions.php. Please fix and try saving again.syntax error, unexpected token “}”
August 1, 2024 at 6:04 am #1463488Hi,
I’m only getting errors if I add it to functions.php, like
Sorry about that. We adjusted the code a bit. Please try it again:
add_filter("avf_post_slider_args", function($atts, $context) { if ($context == "archive") { $atts['type'] = 'grid'; $atts['columns'] = 4; $atts['preview_mode'] = 'custom'; $atts['image_size'] = 'medium'; } return $atts; }, 10, 2);
Best regards,
IsmaelAugust 1, 2024 at 10:22 am #1463507Yes. This worked. Thank you very much. I really appreciate the high quality of support you guys offer :)
August 1, 2024 at 12:09 pm #1463517Hi,
Thanks for the update. Please let us know if you should need any further help on the topic, or if we can close it.
Best regards,
RikardAugust 1, 2024 at 3:25 pm #1463531No more help need with this issue. Thank you.
August 2, 2024 at 5:37 am #1463572 -
AuthorPosts
- The topic ‘Blog Thumbnail Size’ is closed to new replies.