• Hi. I am going crazy trying to figure out where the glitch is.

    I am using the Clear Line theme.

    https://citygalonthego.com

    The Clear Line options are set as follows:

    Thumnails on front page – 270×175
    All thumbnails on front page are this size, all uniform, no issues.

    The thumbnails for other pages set to 265×200. OK.
    However, some images load at 265×200 and the remaining load at 265×175. I have no idea why. I have re-uploaded the thumbnails, I have regenerated the thumbnails using this app – nothing works. I can tell you, the thumbails load at different sizes based on the camera I used to take the photograph. For example, the older travel blog posts which I took with my old camera all load at the right size. However, I recently purchased a DSLR and those photos are loading at 265×175 for some reason. When I check the source code, you can see the difference in size on category pages such as travel. The size difference isn’t immediately noticeable, but I obviously want it perfect.

    Again, I must restate, I have both regenerated all of the thumbnails and removed the featured image and re-uploaded it with the 256×200 size. Neither of them made the photo actually 265×200. They stay the same at 265×175. Annoying.

    I thought, ok, maybe I’ll just make all the images 265×175, but when I do that, the images that loaded at 265×200 originally become smaller and the thumbnail border has too much space on both sides and then the size difference is VERY noticeable.

    I have no idea why this is happening.

Viewing 11 replies - 1 through 11 (of 11 total)
  • What are the original image dimensions?

    It could be that one of your cameras is using different image ratios?

    I would assume that WordPress would crop on my width and height, but perhaps it is only cropping by width, which would result in the 175 height if the images were originally wider than the older images.

    Another suggestion I have is to do a site-wide search of 175 in the php files. See if there is anywhere that it is setting this alternate size.

    Thread Starter citygalonthego

    (@citygalonthego)

    I have tried everything. It’s also leaving one of my instagram photos as a square, so I think it has something to do with the original shape of the photo. BUT, it’s very strange, bc on the front page it has no problem resizing them all to the same size. Then on the interior pages, it doesn’t do that uniformly. It’s driving me crazy. But it’s not very noticeable and I am using the same camera going forward, so it’s fine. If someone knows how to fix this or why it is happening though, please let me know!

    I looked at the theme code and there are 2 img sizes set via the theme options. There is a defined column-thumbnail which is set as hard crop meaning that the image will be scaled down to the size specified. These are the images that are on the home page.

    The other img sized defined is set_post_thumbnail_size which is also defined via the theme options but this is set as soft crop meaning that the image will retain it’s ratio as it’s scaled down. I believe these are the images you are having problems with.

    if (function_exists('set_post_thumbnail_size')) set_post_thumbnail_size( $options[$shortname . '_normal_thumbnail_size_x'], $options[$shortname . '_normal_thumbnail_size_y']);

    Needs to be changed to:

    if (function_exists('set_post_thumbnail_size')) set_post_thumbnail_size( $options[$shortname . '_normal_thumbnail_size_x'], $options[$shortname . '_normal_thumbnail_size_y'], true );

    Adding the true argument at the end sets it to hard crop. See https://codex.www.ads-software.com/Function_Reference/set_post_thumbnail_size for reference.

    It’s not really a good idea to change the theme file and it seems like a lot of work to create a child theme just to override one function so I wrote a quick plugin to override this. You can copy the following code to a file named citygal-fix-thumbnails.php and it to your sites wp-content/plugins directory then activate it through the dashboard.

    <?php
    /*
    Plugin Name: CityGal Fix thumbnails
    Description: Overrides the Clear Line themes soft crop thumbnail setting
    Author: c3mdigital
    Author URI: https://c3mdigital.com/
    Version: 1.0
    License: GPL v2 - https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    */
    
    function citygal_fix_thumbnails() {
    	/**
    	 * Width: 265px
    	 * Height: 200px
    	 * Crop factor: hard crop (absolute)
    	 * @see https://codex.www.ads-software.com/Function_Reference/set_post_thumbnail_size
    	 */
    	set_post_thumbnail_size( 265, 200, true );
    }
    
    /**
     * We are attaching the function to template_redirect to make sure it fires after
     *  The theme functions.php file.  We would probably be ok using the init hook here
     *  but better safe than sorry.
     */
    add_action( 'template_redirect', 'citygal_fix_thumbnails' );

    **You will need to run regenerate thumbnails again after the plugin is activated.

    I tested the fix and the function needs to be attached to the init hook to work. Here is the correction:

    <?php
    /*
    Plugin Name: CityGal Fix thumbnails
    Description: Overrides the Clear Line themes soft crop thumbnail setting
    Author: c3mdigital
    Author URI: https://c3mdigital.com/
    Version: 1.0
    License: GPL v2 - https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    */
    
    function citygal_fix_thumbnails() {
    	/**
    	 * Width: 265px
    	 * Height: 200px
    	 * Crop factor: hard crop (absolute)
    	 * @see https://codex.www.ads-software.com/Function_Reference/set_post_thumbnail_size
    	 */
    	set_post_thumbnail_size( 265, 200, true );
    }
    
    /**
     * We are attaching the function to the init hook so it fires after the theme
     *  functions.php file.
     */
    add_action( 'init', 'citygal_fix_thumbnails' );

    I think the problem is a bit same with my problem.

    Actually my blog‘s homepage shows the featured image as thumbnails but the thumbnail appears big in some posts and small in others, it’s according to the size used inside the post. Can i give a definite size to the thumbnail? so that all the thumbnails in my homepage appears in the same size. It will look better then. Thanks in advance.

    wp-admin -> settings -> media, leave the 2nd area where you type in the height size blank, and uncheck the checkbox on those size options.

    Then use the ajax thumbnail regenerator plugin to regenerate your thumbnails.

    AM also Having thumbnail Size Problems On My Blog.. I Would Say Thank You If Somebody Helps Me Too…

    The Thumnails Appear very Large Because of this…SO plz Help..

    Thanks Frumph, I’ll try. ??

    you can use “Thumbnail for Excerpts” plugin to generate thumbnails automatically. you can select various sizes. take a look at My Blog

    Hey, y’all, don’t hijack someone else’s thread. Unless you’re helping the original poster, start your own.

    Forum_Welcome

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Regenerate Thumbnails’ is closed to new replies.