-
AuthorPosts
-
September 11, 2023 at 12:18 pm #1418734
Hi,
a while ago I asked how we can change the size of the thumbnails on our blog archive pages. We need to do this because we have text on our images which is cut off with the predefined images size. You gave me a reply which I have understood (see below) – but can I implement this change in the child theme? I´ve tried adding this code but it isn´t making any difference, which suggests that I am doing something wrong ;) I have to add that I don´t know much about php. I re-uploaded one of the thumbnails after adding the code but that also made no difference./* Resize portfolio thumbnails on archive/category pages in the blog */
$avia_config[‘imgSize’][‘portfolio’] = array( ‘width’ => 710, ‘height’ => 375 ); // images for portfolio entries (2,3 column)You replied:
Hi,
Thank you for your patience and the links to your site, the portfolio size images on the archive pages is set by line 190 in the enfold/functions.php fileI didn’t find an easy way to adjust the image size on the archive page so I would recommend changing the portfolio size from array(‘width’=>495, ‘height’=>400 ); to mmatch the magazine size array(‘width’=>710, ‘height’=>375 ); and then you will need to regenerate your thumbnails and then check.
This would also change any other use of the portfolio thumbnails on your site, but it doesn’t look like this would be an issue for you.Best regards,
MikePost Link: https://kriesi.at/support/topic/change-layout-number-of-columns-on-blog-category-pages/#post-1310490
September 12, 2023 at 7:45 am #1418840Hey sarawh,
Thank you for the inquiry.
You can use the avf_modify_thumb_size filter to adjust the dimension of the existing thumbnails instead of directly editing the functions.php file. Usage examples can be found in the following threads.
// https://kriesi.at/support/topic/alter-featured-image-on-blog-does-not-work/#post-1342432
// https://kriesi.at/support/topic/title-and-image/#post-1304670
// https://kriesi.at/support/topic/source-for-masonry-image-size/Best regards,
IsmaelSeptember 20, 2023 at 9:56 am #1419679Hi Ismael,
that basically works, thanks. I just need your help with one small thing:
It is on category pages shown in the link below that the thumbnail sizes aren´t right and they don´t seem to be targeted by $size[‘portfolio‘]. Can you tell me which description I need to use? Thanks!
Best regards,
SaraSeptember 21, 2023 at 5:29 am #1419819Hi,
Thank you for the update.
It is on category pages shown in the link below that the thumbnail sizes aren´t right and they don´t seem to be targeted by $size[‘portfolio‘]. Can you tell me which description I need to use? Thanks!
To adjust the thumbnail in the category or archive pages, try to add this filter in the functions.php file. This modification will set the “portfolio” size as the default thumbnail.
add_filter("avf_post_slider_args", function($atts, $context) { if( $context == "archive" ) { $atts['preview_mode'] = 'custom'; $atts['image_size'] = 'portfolio'; } return $atts; }, 10, 2);
Best regards,
IsmaelSeptember 21, 2023 at 12:27 pm #1419894Great, that worked. Thanks, Ismael.
Best regards,
SaraSeptember 22, 2023 at 4:31 am #1419976Hi Sara,
I’m glad that Ismael could help you :)
Thanks for using Enfold and have a great day!Best regards,
Nikko -
AuthorPosts
- The topic ‘Resize thumbnails on archive pages’ is closed to new replies.