Move the listing category description below listings

Hi there,
I am using Listing Hive and my SEO agency would love to include text in the categories. But when we fill in text in the description it will be added in the picture under the category itself. It should be below the listings under the category.
Please see the pictures attached. Text should be separately under the listings but not in the picture.
Can anyone help to solve this issue?
Best regards,
Sabine


Hi,
Please try this PHP snippet (How to add custom code snippets - HivePress Help Center):

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

It worked! Thank your very much for your help!
Merry Christmas!

1 Like

Hi,
unfortunately the solution is back to the beginning.
Snippet is still there but the separate text field below listings is not there any more. Text is once more in description and on the category pictures. Please see photo attached.
Can you please help?

Best regards,
Sabine

Hi,

Please disable third-party plugins and customizations (if there are any) and check if this issue persists. If you use a caching plugin, make sure that caching is disabled for logged-in users.

Hi,
there are no customizations and I only use a few plugins. I don’t use a caching plugin.
Do you have a clue which plugin can cause this issue?



Hi,

Please try to disable all plugins except for HivePress, Code Snippets, and WooCommerce plugins, if the problem disappears after disabling them, then you can enable one plugin at a time, and it will be clear which one conflicts with this code fragment.

If this issue persists, please send temporary WP access to support@hivepress.io with details for reproducing this issue, and we’ll check it. You can create a temporary access link using this plugin Temporary Login Without Password – WordPress plugin | WordPress.org

P.S. If you purchased a theme or extension, please enter the license key in the forum profile settings, this will enable the Premium Support badge and ensure a 24-hour turnaround time.

Hi,
thanks for your answer.
I disabled all plugins except the ones you mentioned and the problem still exits. I will send all details to support.
thanks for your help.

Hi,

Please add this PHP snippet too:

add_filter(
 'hivepress/v1/templates/listing_category_view_block', 
 function($template){
  hivepress()->template->fetch_block($template, 'listing_category_description');

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

Hi,
it worked!
Thanks!

Hi Andrii,

since I deactivated and activated all plugins, there is no more tracking in Google Analytics. Can you help what is the reason for it?

Best regards,
Sabine

Hi,

In our HivePress extension, there is nothing related to Google Analytics.
Please provide more details about your problem, maybe you mean this extension
Statistics - Allow users to view listing statistics | HivePress Extensions.

Please refer to their support or documentation if it is a third-party extension.

Hi,
thanks for your answer. It does work since yesterday evening. Don’t know why but I am glad. Thanks for your help.

1 Like