-
AuthorPosts
-
April 29, 2024 at 11:26 pm #1441358
Hi there
Is there a way to change the featured image dimensions on an individual blog post? its hard to find images that are always landscape like the default sizing – be good to be able to just have whatever the original image size is if possible.
Cheers
Natasha- This topic was modified 7 months, 3 weeks ago by xfacta.
April 30, 2024 at 5:37 am #1441371Hey xfacta,
Thank you for the inquiry.
You can adjust the default width and height of the thumbnails used in the blog posts by adding this code to the functions.php file:
function avf_customization_modify_thumb_size( $size ) { $size['entry_without_sidebar'] = array( 'width' => 9999, 'height' => 9999 ); $size['entry_with_sidebar'] = array( 'width' => 9999, 'height' => 9999 ); return $size; } add_filter( 'avf_modify_thumb_size', 'avf_customization_modify_thumb_size', 10, 1 );
After adding the code, you have to regenerate the thumbnails or upload the images again:
// https://wordpress.org/plugins/regenerate-thumbnails/
Please make sure to create a site backup before proceeding.
Best regards,
IsmaelApril 30, 2024 at 5:57 am #1441376Hey Ismael
ok great thank you – so that will just keep the featured image its actual size and not change/crop it to a fixed size?
Cheers
NatashaApril 30, 2024 at 6:44 am #1441388Hi,
Thank you for the update.
so that will just keep the featured image its actual size and not change/crop it to a fixed size?
Yes, we set the maximum size of the post thumbnails (entry_with_sidebar and entry_without_sidebar) to 9999px, so uploading any images smaller than that size should remain or display as they are. After adding the code, please make sure to regenerate the thumbnails or upload the featured images again.
Best regards,
IsmaelApril 30, 2024 at 8:25 am #1441394masonry image size is a non-cropped size too. ( or use full images )
so – if you use that snippet in child-theme functions.php it will use that image-size format:function av_remove_featured_image_link($image) { if (is_single()) { $image = get_the_post_thumbnail( $current_post['the_id'], 'masonry' ); } return $image; } add_filter('avf_post_featured_image_link','av_remove_featured_image_link', 10, 1);
April 30, 2024 at 9:42 am #1441409Hi,
@Guenni007: Thanks for the info.
@xfacta: You can also try the filter provided by @Guenni007 above to change the post thumbnail.Best regards,
IsmaelApril 30, 2024 at 11:23 am #1441432Thank you both I will try that
April 30, 2024 at 2:29 pm #1441455Try first only my solution without redefining the featured image source – this will only use a different image-size source for that featured image.
And because masonry image-size is a non cropped size – use that.________________________
btw: on your copyright link in the footer you have made some mistakes.
i would only insert that line:© Copyright - NSW Dowsers Society. All Rights Reserved.
and add to my child-theme functions.php:
function new_backlink(){ $kriesi_at_backlink = " - <a href='https://xfactadesign.com' target='_blank'>Xfacta Design</a>"; return $kriesi_at_backlink; } add_filter('kriesi_backlink' , 'new_backlink');
or maybe clearer in that way:
function my_own_backlink($link){ $no = "rel='nofollow'"; $slogan = "Website Design by - "; $theme_string = "Xfacta Design"; $backLink = "https://xfactadesign.com"; $link = "{$slogan } <a {$no} href= {$backLink} target='_blank'>{$theme_string}</a>"; return $link; } add_filter( 'kriesi_backlink', 'my_own_backlink', 10, 1);
that snippet set the new value for the backlink. in this case you do not need to add the shortcode [nolink]
May 17, 2024 at 1:36 am #1443979@Guenni007 thanks so much for that functions info it worked perfectly :-)
just on the copyright part why is what I have a mistake and needed to be added to the child theme functions?
Cheers
NatashaMay 18, 2024 at 10:09 pm #1444404Hi,
Your website link in the copyright (Website Design by) is broken, try clicking it.
If you are not using a child theme you could use the WP Code plugin then add a new snippet, in the top right corner use the PHP snippet as the code type:
then add Guenni007’s code and save.Best regards,
MikeMay 19, 2024 at 8:03 am #1444478Hey Mike
thanks for letting me know that – I have fixed it now :-)
Cheers
NatashaMay 19, 2024 at 12:25 pm #1444512Hi,
Glad Guenni007 could help, thank you Guenni007, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.Best regards,
Mike -
AuthorPosts
- The topic ‘Change dimensions of featured image in single blog post’ is closed to new replies.