Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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! :)

    #462335

    Hi 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,
    Ismael

    #462407

    Thanks! 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. :)

    #462465

    Hi!

    By regenerating all thumbnails it should work.
    Do you have any cache scripts activated?

    Regards,
    Basilis

    #462996

    No, 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!

    #463209

    Hi!

    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!
    Ismael

    #464415

    Bah! 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!

    #464780

    Hi!

    No problem, glad you got it fixed :)

    Regards,
    Rikard

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Blog Preview Image Cuts Heads Off’ is closed to new replies.