Change the Category Block Image size

Hi there,

I have a Listing Hive page and in the homepage I have the default Categories block that came with the demo. I have 6 categories and 3 columns. Because of the category image size it takes a lot of space from the mainpage, I wanted to cut down the image size so it will take less space.

I am not able to fix the image size for the Category block, even though I tried to follow the help from here. Downloaded the snippets - plugin, added there a new snippet (run snippet everywhere). Only changed the height and width to see if the images will get smaller.

add_filter(
	'hivetheme/v1/image_sizes',
	function( $image_sizes ) {
		$image_sizes['portrait_small']['height'] = 103;
		$image_sizes['portrait_small']['width'] = 103;

		return $image_sizes;
	}
);

After adding the snippet I updated the category pictures from the categories-menu, but nothing happened.

What am I missing? Thank you in advance for the help!

Hi,
The snippet seems to be correct, please make sure that it’s added correctly and you re-uploaded images after adding it. Please note that it can be used to change the aspect ratio rather than size, since the image width will fill the category block anyway, even if it’s set to 103px it’ll be stretched. You can control the aspect ratio though, e.g. if you set 400x400px size then category blocks will be square.

Thank you for the reply!
Is there a possibility then to change the size of the category block with the block setting being 6 categories and 3 columns?

Hi,

Please try to change the number of categories shown on the page by going to the WP Dashboard > Pages > Homepage section. Then select a categories block and in the right menu change the number of categories.

Hello,

I would like to change the size of the whole block. So that it takes less space. With 6 categories it looks nicer to keep 3 columns, 2 rows. I just want to change the categories block to take less space, as it takes almost a full page lenght now to see all categories.

I tried to bypass the size reduction by using this snippet to have 6 columns, but it did not work.

add_filter(
	'hivepress/v1/templates/listing_categories_view_page',
	function( $template ) {
		return hivepress()->helper->merge_trees(
			$template,
			[
				'blocks' => [
					'listing_categories' => [
						'columns' => 6,
					],
				],
			]
		);
	}
);

Also while we are at it, is there a way to have the review-button to be much bigger? And can it be moved to other places in the listings? Thanks alot for the support, really appreaciate it!

Hi,

Sorry, there’s no simple code snippet for this, it would require a custom implementation. If customizations beyond the available features are required for your site, please consider hiring someone for custom work https://fvrr.co/32e7LvY

Hi Andrii,

Thank you for your quick reply.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.