-
AuthorPosts
-
June 20, 2015 at 5:49 am #462153
Hello,
I found this post that was very similar, and I tried, it, but it must not be targeted for what I’m after: https://kriesi.at/support/topic/show-featured-post-image-from-the-top-down-and-stretch-smaller-images-to-full-s/.My site is http://www.thestylestudiobykb.com/. What I need is for the blog preview images on the home page to be cropped starting at the top instead of center, so that heads of people aren’t cut off. I’m not very versed in PHP – is there a similar code you can offer that would accomplish this?
Thanks! :)
June 21, 2015 at 12:50 pm #462335Hi Taryn!
Thank you for using Enfold.
Looks like you added the image directly in the post editor. Please add the feature image again but before that, add this code in the functions.php file to adjust the thumbnail size:
function ava_image_sizes() { add_image_size('entry_with_sidebar', 845, 321, array('center', 'top')); add_image_size('entry_without_sidebar', 845, 321, array('center', 'top')); } add_action( 'after_setup_theme', 'ava_image_sizes', 11 );
Regenerate or upload the images again. You can adjust the width, default is 845 and the height, default 321. The array(‘center’, ‘top’) is the crop positioning of the images, it will crop from the bottom, left and right, leaving the center and top portion of the images. https://codex.wordpress.org/Function_Reference/add_image_size
Regards,
IsmaelJune 22, 2015 at 12:36 am #462407Thanks! I’m evidently missing something. I added the code and adjusted the size to be what I need for that preview image. I regenerated the thumbnails. Do you mean I need to now to in to every post, remove the Featured Image, and then reset it, or remove the image used for the Featured Image all together from the Media Library?
Thank you for your help and patience. :)
June 22, 2015 at 7:36 am #462465Hi!
By regenerating all thumbnails it should work.
Do you have any cache scripts activated?Regards,
BasilisJune 22, 2015 at 7:08 pm #462996No, I don’t. I’m stumped. An example of one that it’s doing this on is about the 3rd or 4th one down – the preview image is cut off at the top, so her head is cut off. Making my client upset and I can’t figure out how to fix it. :( (http://www.thestylestudiobykb.com/)
Thanks!
June 23, 2015 at 10:07 am #463209Hi!
Can you give us an example of the image that is being cut off? I checked the “blog-like” section below and if I am not mistaken, it’s from a third party plugin, “srp-widget” or something. Please contact the plugin author regarding that.
Cheers!
IsmaelJune 25, 2015 at 5:44 am #464415Bah! I can’t believe I didn’t think of that. It was of course due to the plugin we’re using to display posts in that section. I was able to use the Simple Image Sizes plugin you suggested to help me, so I hope you don’t feel like you wasted your time on this one. It was helpful to me. :)
Thanks!
June 26, 2015 at 6:20 am #464780 -
AuthorPosts
- The topic ‘Blog Preview Image Cuts Heads Off’ is closed to new replies.