Changing the default image for listing without photos

Hello ! I want to change the default image for listings. Is that possible ? thanx

If you mean the listing block then you could try to replace default placeholder image if you override the /listing/view/block/listing-image.php template part via a child theme. This may be also possible via CSS (e.g. making the placholder image transparent and adding another background).

There is also a tutorial how to customise templates Customizing Templates I HivePress Developer Docs - YouTube

Hope this helps.

2 Likes

Is there a way to get the image displayed in the block to be an image added to the listing (instead of the author’s profile picture)? For instance, I’d like to replace the circular image here in the first picture with the image that gets displayed on the left-hand side of the detail page in the second image. Any help would be much appreciated!

Please try this PHP snippet

add_filter(
	'hivepress/v1/templates/listing_view_block/blocks',
	function( $blocks, $template ) {
		return hivepress()->helper->merge_trees(
			[ 'blocks' => $blocks ],
			[
				'blocks' => [
					'listing_image' => [
						'path' => 'listing/view/block/listing-image',
					],
				],
			]
		)['blocks'];
	},
	1000,
	2
);
1 Like

That worked! Thank you!

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