Can we show the label of description in listing details page and Make it first item to show on page

Yes. Here is the code snippet to put a header before the listing description:

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
);

Change and input your title above, for example if you just want it to say description, then write that there. Also, if you want the header bigger change it from h6 to h1 (It ranges in sizes from h1, h2, h3, until h6). Last thing you can change the order number in the code to rearrange where you want it. 0 will make it be all the way on top of the page. The higher the number the lower it will move it down in the page.


Here is the code snippet to put the listing description on the top:

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

Hope this helps! :slightly_smiling_face:

1 Like

thank you for your help
but where i put this code beacuse I tried to

  1. insert into listing description field but it doesn’t work.
  2. Then I tried listing child child theme in ffunction.php file but doesn’t work please help.

Install and activate the code snippet plugin. Then add each code separate

but where

Go to your wordpress dashboard. It should have a code snippet tab. Open that. And add new. Copy and paste code. Beginning on line 1

sir please see and let me know where I am wrong

  1. Looks like you downloaded a different code snippet plugin. Did you download the Code Snippets by Pro?

I have the setting on: Run snippet everywhere
Looks like you are only running on front end. Maybe that is the problem?

This is what my code snippet screen looks like:

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