ThemeShaper Forums » Thematic


Images not displaying at specified size

(4 posts)
  • Started 7 years ago by proto
  • Latest reply from proto
  • This topic is resolved
  1. proto

    Hello all,

    As I've been getting such wonderful help on here I've been trying to put back and answering some queries on here. I had a (hopefully) a quick question that I hoped someone could help me with, my images sizes I specify are not displaying to the same size when I output them in on my homepage, I've set them to 300 height and 340 width but they display as 300 X 300

    In my functions file I've setup support for thumbnails, including thumbnail crop like so:

    // Add support for thumbnails
    add_image_size('book_now', 220, 200, true);
    add_image_size('workout_images', 220, 300, true);
    add_image_size('nivothumb', 940, 300, true);
    add_image_size('home_grid', 300, 340, true);

    In my loop I call the image size 'home_grid':

    <?php query_posts('category_name=fitness&posts_per_page=1');?>
    <?php while (have_posts()) : the_post();?>
          if (has_post_thumbnail()) {
          } ?>
          </div><!-- fitness -->

    Any ideas why they are not quite coming out the same size.?

    Here's the website to see them at the 300 X 300 rather than the requested 300 X 340:

    I tried adjusting the true and false as I believe this is cropping with ratios, any thoughts greatly appreciated! Thank you! :)

    Posted 7 years ago #
  2. proto

    Anyone have any thoughts please!? :)

    Posted 7 years ago #
  3. if you made this change after you uploaded the photo the 300x340 image does not exist. or if your image isn't that same proportion then it might not generate at the exact size. i'd try using the regenerate thumbnails plugin.

    Posted 7 years ago #
  4. proto

    Thanks Helga,

    As ever you're very helpful. I'll give it a whirl, relieved that nobody flagged any problems with my code!!

    Posted 7 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.