• I am having a problem with the display of featured images on the homepage.

    The thumbnail images are being cropped on the left- and right-hand sides when displayed on the homepage.

    The featured images do display correctly in both the archive section and within the post editor. The problem is only on the homepage.

    Also, images that are added within the post are also displaying correctly on both the homepage and in the archive. Only the featured images have this problem.

    I have changed the media settings in a variety of ways and reloaded the images, but nothing has solved this. Any help would be appreciated.

    Thanks very much.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Theme Author Richie KS

    (@rkcorp)

    seem fine to me, both featured images look the same cropping in all area.
    check the theme demo in my site.

    Thread Starter pch101

    (@pch101)

    Thanks for the prompt followup.

    The cropping effect is also an issue on your demo theme. For example, if you compare the Hugh Jackman image on the homepage to the same image on the archive page, you’ll see that the homepage version of the image is being cropped on the sides.

    I should also add that the featured image is not showing up inside of my posts. If there is a way to fix both of these problems, that would be very helpful.

    Thanks again.

    Theme Author Richie KS

    (@rkcorp)

    that’s because the homepage featured image is using ‘thumbnail’ and the archive featured image is using ‘medium’ so both will be different in crop dimension. where ‘thumbnail’ use 150×150 default and ‘medium’ use 300×200 default. so it is not a flaw in theme, its how the wp featured thumbnail work.

    thumbnail
    hxxp://cdn.dezzain.com/2/2012/10/wolverine-150×150.jpg

    medium
    hxxp://cdn.dezzain.com/2/2012/10/wolverine-300×200.jpg

    see the different…

    if you want all the featured image using ‘thumbnail’, just open archive.php and index.php and edit

    <?php
    if( wp_is_mobile() ) { $postimg = 'full'; } else { $postimg = 'medium'; }
    echo dez_get_featured_post_image("<div class='post-thumb in-archive'>".$thepostlink, "</a></div>", 300, 300, "alignleft img-is-". $postimg, $postimg, dez_get_singular_cat('false'), the_title_attribute('echo=0'), false);
    ?>

    edit $postimg = ‘medium’ to $postimg = ‘thumbnail’

    @featured image in single
    no, featured image only for featured image in homepage and archive thumb, not single post where the content are.

    you can add it yourself, open single.php and add this near the_content()

    <?php
    if( has_post_thumbnail()) {
    echo the_post_thumbnail('full', array('class' => 'alignnone'));
    }
    ?>
    Thread Starter pch101

    (@pch101)

    I think that I may have figured this out. (I don’t really know much code, so please let me know if this is the wrong approach.)

    In the theme functions (functions.php), I believe that the theme was set to crop the thumbnails with this line:

    add_image_size( ‘thumbnail’, 300, 300, true);

    By eliminating the “true” field, I was able to eliminate the cropping effect on the home page. (Is it fair to say that the “true” statement was overriding the media settings on the dashboard?)

    I haven’t noticed any problems that have come from this change. If this was not the best way to do this, then please let me know. Thanks again.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Featured Image Problem – Images Cropped on Homepage’ is closed to new replies.