Move "report a listing" and "write a review" to different location

Hi there!

Could you please provide me code snippet to:

  1. move the “Report a listing” link to the bottom beneath the vendor profile box.
  2. move the “Write a review” link to the bottom beneath the reviews.

Please see the screenshot below to understand exactly what I mean.

Thank you

Hi,

Unfortunately, there’s no such feature, it would require a custom implementation.
You can also try a workaround by overriding separate template parts by copying them to the child theme and moving these sections to the place you need on the page Overview | HivePress Templates - YouTube

Hi, thank you for your reply.

Moving the “Add a review” link is not that important, but “Report listing” is really important. It actually would be great to move the Report listing link from the right site (Primary area) to the left site (Secondary area).

There are several codes which moves elements from the primary area to the secondary area or change the order of elements, like the following:

<?php
add_filter(
	'hivepress/v1/templates/listing_view_page',
	function( $template ) {
		return hivepress()->helper->merge_trees(
			$template,
			[
				'blocks' => [
					'listing_attributes_secondary' => [
						'_order' => 123,
					],
				],
			]
		);
	},
	1000
);

I already found out that “listing_report_link” must target the link. But unfortunately I am not able to make it work. Could you please help me customize the code above to move the “Report listing” link from the right site (where it currently is) to the left site (secondary area).

I appreciate your help and efforts.

Thank you

Hi,

Please try this PHP snippet:

add_filter(
 'hivepress/v1/templates/listing_view_page',
 function( $template ) {
  return hivepress()->template->merge_blocks(
   $template,
   [
    'page_content' => [
     'blocks' => [
      'custom_report_link' => hivepress()->template->fetch_block( $template, 'listing_report_link' ),
     ],
    ],
   ]
  );
 },
 1000
);

Please note that you may require additional customizations in the future.

1 Like

Amazing, thank you!