Category tag on the Listing block

Is it possible to add category tags to listing blocks?
These tags that show up on the single listing page:


to the listing block and have it show up either at the top or the bottom of the listing block:

Hi,

Please use this PHP snippet:

add_filter(
	'hivepress/v1/templates/listing_view_block/blocks',
	function( $blocks, $template ) {
		return hivepress()->helper->merge_trees(
			[ 'blocks' => $blocks ],
			[
				'blocks' => [
					'listing_content'         => [
						'blocks' => [
							'listing_category' => [
								'type'   => 'part',
								'path'   => 'listing/view/listing-categories',
								'_order' => 5,
							],
						],
					],

					'listing_details_primary' => [
						'blocks' => [
							'listing_category' => [
								'type' => 'content',
							],
						],
					],
				],
			]
		)['blocks'];
	},
	1000,
	2
);
1 Like

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