Join our new community forum for support & discussion

Join Now

Home Support General HivePress How to change default images size?

How to change default images size?

  • Author
    Posts
  • blacklevel

    How to change default images size?
    All images created as 800×600 size. How to change this (for example I want 16:9 images)?

    ihor developer

    This code snippet should work (you can add it to the child theme functions.php file):

    add_filter(
    	'hivepress/v1/image_sizes',
    	function( $image_sizes ) {
    		return HivePress\Helpers\merge_arrays(
    			$image_sizes,
    			[
    				'landscape_small' => [
    					'width'  => 400,
    					'height' => 225,
    				],
    
    				'landscape_large' => [
    					'width'  => 800,
    					'height' => 450,
    				],
    			]
    		);
    	}
    );

    You can then re-generate thumbnails for existing images if there’re any https://wordpress.org/plugins/regenerate-thumbnails/

    Rede Cultura Torres

    It is possible to leave image proportion size of uploaded images? I feel that previous version of Hivepress worked that way:
    see here:
    https://redeculturatorres.org/listing/grito-rock/ (square logo, uploaded time ago)
    and new listing after new version:
    https://redeculturatorres.org/listing/rosa-de-venus-ao-vivo/ (square CD cover, uploaded yesterday)
    i need to leave img size as loaded, photos could be CD cover, logo, portrait photo, landscape photos…
    thanks in advance!

    ihor developer

    These images have the original size because they are smaller than 800×600 (e.g. the first one is 600×600 so it’s not resized/cropped). You can try overriding image settings using the above code snippet and set the height to “0”, then images will have the width of 800px max and the height will not be cropped, so there will be the original aspect ratio.

    Rede Cultura Torres

    Thanks! Like this? : (I’m not so close to coding)

    add_filter(
    ‘hivepress/v1/image_sizes’,
    function( $image_sizes ) {
    return HivePress\Helpers\merge_arrays(
    $image_sizes,
    [
    ‘landscape_small’ => [
    ‘width’ => 400,
    ‘height’ => 0,
    ],

    ‘landscape_large’ => [
    ‘width’ => 800,
    ‘height’ => 0,
    ],
    ]
    );
    }
    );

    ihor developer

    Sure, this one should work:

    add_filter(
    	'hivepress/v1/image_sizes',
    	function( $image_sizes ) {
    		return HivePress\Helpers\merge_arrays(
    			$image_sizes,
    			[
    				'landscape_small' => [
    					'height' => 0,
    				],
    
    				'landscape_large' => [
    					'height' => 0,
    				],
    			]
    		);
    	}
    );
    GUJIMO

    Thank you very much ihor you save my day hehe
    The last solution was what I needed in order to have the result I was looking for 🙂

    http://www.propiedadesadvice.mx

    mjda

    Hi there,
    I use HivePress with ListingHive in order to list some shops in my neighborhood and am using each shop logo as featured image. This works like a charm when browsing listings grid but when displaying the presentation of a specific store the logo is displayed at 100% of the primary column’s width.

    Can you help me displaying the logo in a smaller square size that would prevent having to scroll down to read the description ? The best scenario would be to display the logo next to the shop name and address area.

    ihor developer

    Hi,
    Please try using our new community forum https://community.hivepress.io/ This one is being deprecated and we will switch it to read-only within a few days.
    If you mean moving the listing gallery to the right sidebar instead of the wide left content area there may be a snippet for it, please create a new topic on the community forum.

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

New Reply

This forum has been archived and is no longer accepting new posts or replies. Please join our new community forum for support & discussion.

Black Friday sale! Get 30% off with FRIDAY22 coupon until Tuesday, November 29.
This is default text for notification bar