This topic has 7 replies, 4 voices, and was last updated 8 years by Abe.

  • Author
  • #18476
     Patagonia
    Participant

    Hi, I noticed that on the archive and blog masonry pages each entry has a 480px wide version of the featured image. In the site folders I also saw 672px wide versions of uploaded images.

    1) In my wordpress option (Settings -> media) I have the standard sizes (1024/300/150px), so where did these images come from?

    2) The images are resized and overkill. For example a 60kb 480px is only shown at 179px or 284px width (depending on blog vs archive view). In both cases a much smaller image would suffice. Where is this defined and can we optimize it?

    Cheers

    #18730
     Abe
    Keymaster

    Hi, Since 1.4.2 those sizes are stored in a theme variable in wp-content\themes\kleo\lib\theme-functions.php:
    //Post image sizes for carousels and galleries
    $kleo_config[‘post_gallery_img_width’] = 480;
    $kleo_config[‘post_gallery_img_height’] = 270;

    To change those values without altering main theme files add this code in your kleo-child/functions.php

    COPY CODE
    
    /* Change KLEO default image size */
    add_action( 'after_setup_theme', 'kleo_change_image_sizes' );
    function kleo_change_image_sizes() {
    	global $kleo_config;
    
    	//Post image sizes for carousels and galleries
    	$kleo_config['post_gallery_img_width'] = 400;
    	$kleo_config['post_gallery_img_height'] = 200;
    }
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #24795
     Patagonia
    Participant

    Hi, coming back to this with a related request:

    I have prepared images to be used as featured images, they are exactly 900px wide. I changed my theme/css so that the featured image/container is this width as well.

    However, after selecting one of these images, a smaller version (that I did not define, for example 769px wide) is selected which is upscaled, which degrades the image quality. If I delete that version, no image is shown, so KLEO is looking for a smaller version, it does not pick a larger version.

    How can I be sure that the full-size version / 900px version is being used as the featured image? Of course I want to use smaller versions for the masonry etc.

    Thanks in advance!

    #24798
     Patagonia
    Participant

    I noticed that the problem lies in this part of kleo/functions.php:

    COPY CODE
    	/* This theme uses a custom image size for featured images, displayed on "standard" posts. */
    	add_theme_support( 'post-thumbnails' );
    	set_post_thumbnail_size( 672, 9999 ); // Unlimited height, soft crop 
    	add_image_size( 'kleo-full-width', 1038, 583 );
    

    If I change the last line to 900,999, then the 900pxx version is used.

    Of course I should not edit the Kleo/functions.php, can I just add the above function to the child’s functions.php? Or just the last line?

    Thanks

    #25035
     Abe
    Keymaster

    to change that size you should add this in the functions.php from the child theme

    COPY CODE
    
    add_action( 'after_setup_theme', 'kleo_setup_image_size', 11 );
    function kleo_setup_image_size() {
    set_post_thumbnail_size( 672, 900 );
    }
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #25046
     Splendor
    Participant

    Great I had the same dilemma..

    #59403
     Tom
    Participant

    Hi,

    I have a similar problem to this.

    – I uploaded a portrait orientation image with dimensions of 2448 × 3264 to the WordPress Media Library.
    – I created a new post, and selected the above image as my featured image.
    – I published the post.

    On the single post page, the image is displaying a 437 x 583 pixel image SCALED UP to 764 x 1019 pixels.

    So this seems to be re-sizing my original image to a height of 583 pixels based on this line in kleo/functions.php

    add_image_size( 'kleo-full-width', 1038, 583 );

    Which then displays a pixelated image as by scaling the image based on the height, the width is not sufficient.

    Are you sure in order to fix this, it’s correct to change the post thumbnail size from:

    set_post_thumbnail_size( 672, 9999 ); // Unlimited height, soft crop

    to

    set_post_thumbnail_size( 672, 900 ); // Unlimited height, soft crop

    and NOT change the line with the height parameter of 583 which seems to be the function that is setting the incorrect height?

    add_image_size( 'kleo-full-width', 1038, 583 );

    Could someone please clarify this?

    Thanks!

    #60746
     Abe
    Keymaster

    Hi. Sorry for the late reply. The solution you suggest applies for the single page images that are shown by the theme. you need to regenerate the thumbnails once you change the image sizes. Use a plugin like Force regenerate thumbnails

    Thanks

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

Viewing 8 posts - 1 through 8 (of 8 total)

The forum ‘KLEO’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?