• Resolved bithons

    (@bithons)


    Hi,

    I am trying to setup my own thumbnail sizes I am editing the $default_image_sizes array in functions.php but no succes.

    For example I have ‘post-thumbnail’ on width 850 and height 400 with crop on true, when I upload a image and inspect it gives me the size 602 x 400 the size of the image but the image that I upload is 2048 x 1361.

    Can someone explain me why this is happening?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @bithons!
    The better way to change thumbnail sizes is create your own child theme for Azeria. Then add to your child theme file functions.php with next code:

    <?php
    add_filter( 'azeria_image_sizes', 'azeria_child_image_sizes' );
    function azeria_child_image_sizes( $sizes ) {
    
    	$sizes['post-thumbnail'] = array(
    		'width'  => 850,
    		'height' => 400,
    		'crop'   => true
    	);
    
    	return $sizes;
    }

    This sizes will be applied for all new images. To change size of existing images – you need to use Regenerate Thumbnails plugin. We checked this code with exactly the same size image as you describe – all works fine.

    Child themes tutorial you can find here

    Thread Starter bithons

    (@bithons)

    Thanks for you reply it worked, and the Regenereate Thumbnails is a handy one. And I am using a child-theme now.

    I used this code for setting more image size settings, for people who maybe don’t know how to do it.

    $sizes = array(
    		'post-thumbnail' => array(
    			'width'  => 850,
    			'height' => 450,
    			'crop'   => true
    		),
    		'slider-thumbnail' => array(
    			'width'  => 1204,
    			'height' => 900,
    			'crop'   => true
    		),
    		'related-thumbnail' => array(
    			'width'  => 210,
    			'height' => 180,
    			'crop'   => false
    		)
    	);
    
    	return $sizes;
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Thumbnail sizes’ is closed to new replies.