Crop Featured Product Block Images

Support Area Forums Elite Crop Featured Product Block Images

Viewing 2 posts - 1 through 2 (of 2 total)
URL to the page in question: www.labelleviemodesto.com
  • Author
    Posts
  • #18053
    Cody Balos
    Participant

    Hello,

    I would like to keep Woocommerce’s hard cropping on all the products that appear in the featured product block/widget. Currently, images do not crop in that section.

    #18058
    Bill Robbins
    Moderator

    Cody,

    You can change the image size for the home products widget. Here’s how to do that:

    1. Go to the Appearance section in your WordPress control panel and select Edit.
    2. From the list of files on your right, choose images.php
    3. Find this line:
      
      add_image_size('home-product', 360, 480, true);
      

      The first number is the width. I would not recommend changing that otherwise you’ll have layout issues. The second number there is the height. That’s what you’ll want to change to the number of pixels tall you’d like your images to be. The true at the end sets the crop (true = hard crop, false = soft, proportional crop). To learn a bit more about image sizes, see http://codex.wordpress.org/Function_Reference/add_image_size

    4. Save your changes.

    After you do that, you’ll need to run the Regenerate Thumbnails plugin to change the sizes of the images you’ve already uploaded. WordPress gets images to that size by scaling them down until either the width hits the specified width or the height hits the specified height. Then the other dimension is cropped off at that point. If an image is smaller than the specified size, it is not scaled up to fit.

    If you have any questions or trouble, let me know.

    Thanks,
    Bill

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Crop Featured Product Block Images’ is closed to new replies.