Register with your Envato account

Support forums

Homepage Support Polaris WooCommerce How-To: Change resolution of images or/and disable hard cropping?

How-To: Change resolution of images or/and disable hard cropping?

Homepage Support Polaris WooCommerce How-To: Change resolution of images or/and disable hard cropping?

Viewing 1 post (of 1 total)
  • Author
  • #5792

    Theme defines its’ specific image sizes for usage in various locations in the theme.
    All the images are hard cropped, therefore if original image resolution is large enough, image will be cropped to specified resolution.
    This article may help not only to disable hard cropping or change size of images but also detect minimum resolution of images which should be used.

    – Locate folder “[WORDPRESS_INSTALL_FOLDER]/wp-content/themes/[THEME_NAME]/theme/includes/” and open “settings.php” file.
    – Find image size function named “[THEME_NAME]_images_sizes” (or “plsh_images_sizes”), which should be located at the top of file and look similar to this:

    function goodgame_images_sizes()
    	return array(
    		'goodgame_post_list_item_small' => array( 60, 60, true ),
    		'goodgame_post_list_item_medium_small' => array( 270, 270, true ),
    		'goodgame_post_list_item_medium' => array( 389, 389, true ),
    		'goodgame_post_list_item_large' => array( 808, 379, true ),
    		'goodgame_post_single_small' => array( 808, 454, true ),
    		'goodgame_post_single_medium' => array( 1170, 658, true ),
    		'goodgame_post_single_full_screen' => array( 1920, 1080, true ),
    		'goodgame_slider_image' => array( 750, 750, true ),
    		'goodgame_featured_list_item_large' => array( 389, 540, true ),
    		'goodgame_gallery_item_small' => array( 90, 90, true ),
    		'goodgame_gallery_item_large' => array( 870, 640, true ),
    		'goodgame_gallery_embed_item' => array( 404, 404, true ),

    – By using child theme copy/paste image size function’s code to child theme’s “functions.php” file, right before PHP closing tag (?>) at the bottom of the file.
    You should not paste code under PHP class definition or uncomment any code in child theme’s “functions.php” file while passing this step.
    – Depending on property name you can figure out which can be definition for image you are looking for.
    – To disable hard cropping you should replace value “true” with “false”. After this corresponding images will resized to specified dimensions. For example if you change this line
    'goodgame_post_list_item_medium' => array( 389, 389, true ),
    to this
    'goodgame_post_list_item_medium' => array( 389, 389, false ),
    medium sized post featured images in lists which previously were squared now will scaled to the specified dimensions keeping original image aspect ratio. If you are using landscape images, now their width will be 389px, but height will be less than 389px.
    – If you want to increase image size for some reason, for example, make theme Retina Display compatible, you can increase size of images by changing numeric values.

    1. Be careful with adjustments. The best way to do this kind of modifications is by changing image size definitions one by one. Check how it affects your site’s front-end after each modification.
    2. To see changes on your site’s front-end you should regenerate images. This could be done from your wp-admin under “Tools -> Regenerate Thumbnails”.
    3. As we have not tested theme with different image sizes we cannot guarantee that these changes won’t break anything. Therefore any issues raised by these adjustments will be up to you.
    4. Always use child theme if you wish to make any modifications to the theme’s code files.

Viewing 1 post (of 1 total)
You must have active support license to create new replies.

Learn more about Renewing Item Support and Themeforest Item Support Policy.

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.