Move the category listing description to the bottom

How To Moving the category listing description to the bottom. I want showing description after listing block.

I’ve tried with this code but it doesn’t work

add_filter(
	'hivepress/v1/templates/listings_view_page',
	function ($template){
		return hivepress()->helper->merge_trees(
			$template,
			[
				'blocks' => [
					'page_description' => [
						'_order' => '1000',
					],
				],
			]
		);
	},
	1000
);

Thx`

1 Like

Please try this PHP snippet

add_filter('hivepress/v1/templates/listings_view_page/blocks', function($blocks, $template){
		$listing_category = $template->get_context('listing_category');
		if($listing_category){
			$blocks = hivepress()->helper->merge_trees(
					[ 'blocks' => $blocks ],
					[
						'blocks' => [
							'listings_container' => [
								'blocks' => [
									'custom_category_description' => [
										'type' => 'content',
										'content' => category_description($listing_category->get_id()),
										'_order' => 1000,
									],
								]
							]		
						]
				]
				)['blocks'];
		}

	return $blocks;
}, 1000, 2);
1 Like

thanks for helping.

now the description is a duplicate. the first is above (below the title), the second is below the content.
I tried using CSS to hide the top description, it worked. But a problem arises, the category description does not appear on the homepage.
Is there any solution for other code?
by the way, i use the listinghive theme

Please try hiding the top one using this CSS snippet, the category block should still show the description:

.hp-listing-category--view-page .hp-listing-category__description {display:none!important}

In which file should this be changed?

Please check this doc How to add custom code snippets - HivePress Help Center

Substituted this code wherever possible. The theme is basic. I can’t figure out how to move the description down.

Make sure that you added it via the Code Snippets plugin, or to the child theme’s functions.php file. I’ve tested it locally and it seems to be ok, but it doesn’t move the description - it adds the second one at the bottom so the top one should be also hidden with CSS.

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