Description label not showing in listing page

Hi

Further to this post Can we show the label of description in listing details page… I’ve added the suggested code to the Code Snippets plugin but the label still does not show. I’ve also cleared the cache before and after adding the code.


Thanks in advance :slight_smile:

Hi,

We have tested this PHP snippet and it works without any issues. Please make sure that you add it using this doc: How to add custom code snippets - HivePress Help Center

If this issue exists, 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.

​I hope this is helpful to you.

1 Like

Thank you. As above, I’ve used Code Snippet to add the code, so yes - I’ve added it correctly.

This is the code I’m using:

add_filter(
	'hivepress/v1/templates/listing_view_page',
	function( $template ) {
		return hivepress()->helper->merge_trees(
			$template,
			[
				'blocks' => [
					'page_content' => [
						'blocks' => [
							'listing_description_title' => [
								'type'    => 'content',
								'content' => '<h6 class="hp-section__title">Put your custom title here</h6>',
								'_order'  => 0,
							],
						],
					],
				],
			]
		);
	},
	1000
);

It places the custom heading at the TOP of the listing, not at the top of the listing description. Please see attached images.
Could you please advise the amendment required?

Many thanks :slight_smile:


Hi,

Most likely, you are using the second PHP snippet that is published in this topic: Can we show the label of description in listing details page and Make it first item to show on page. I recommend using only the first PHP snippet, then everything should be displayed correctly.

Thanks, as previous, I am using the first PHP snippet i.e.

add_filter(
	'hivepress/v1/templates/listing_view_page',
	function( $template ) {
		return hivepress()->helper->merge_trees(
			$template,
			[
				'blocks' => [
					'page_content' => [
						'blocks' => [
							'listing_description_title' => [
								'type'    => 'content',
								'content' => '<h6 class="hp-section__title">Put your custom title here</h6>',
								'_order'  => 0,
							],
						],
					],
				],
			]
		);
	},
	1000
);

Hi,

I see. Please try to set the order to 190 and check if it is displayed correctly.

Thanks Andrii, I finally got it to work setting it to 60.
I thought the highest order might have been 10, I didn’t think to try any higher.
Is there a way to change the ‘Description’ label in the listing edit screen or better to just use LocoTranslate?

Dee :slight_smile:

Hi,

You can simply go with the Loco Translate.

Thanks @serhii I got it working :slight_smile:

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