Change Location Section Title in Listing Details

Hello,

I’m trying to customize the Listing Details screen in HivePress and I’m having trouble with the “Location” title above the map (geolocation extension). I want to change this title to “Pick Up Location” and eventually make it dynamic based on the category of the listing.

I’ve tried using Loco Translate to change the static “Location” text, but was only able to affect the “location” in the search field and not the area above the map.

Is there a way to change the “Location” title above the map using add_filter? If anyone has any suggestions on how I can customize this, I would greatly appreciate it.

Thank you for your help in advance!

I finally got the Location title changed but I’m not sure if this is the best approach.

Here is the code snippet I’m currently using:

add_filter(
	'hivepress/v1/templates/listing_view_page',
	function( $template ) {
		$template['blocks']['page_container']['blocks']['page_columns']['blocks']['page_content']['blocks']['location_container']['title'] = 'Pick Up Location';
		return $template;
	},
	1000
);

While this works, I’m not sure if it is the best (most efficient?) approach. Can someone with more experience confirm if there is a better way to change the location title?

I would love to understand this structure more and a better way to target these blocks as it’ll help us with future customization.

Thank you in advance for your help!

Hi,

Yes, this code looks good, you can use it.

Thanks, appreciate it!

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