Trying to override listing-location.php in my child theme but it doesn’t do it even folder structure is kept. The code works when amending original file. Trying to shorten the displayed address with this code:
<?php
/**
* Listing location template.
*
* This template can be overridden by copying it to yourtheme/hivepress-geolocation/templates/listing/view/listing-location.php.
*
* @param HivePress\Models\Listing $listing Listing instance.
*/
defined( 'ABSPATH' ) || exit;
if ( $listing->get_location() ) :
$location = $listing->get_location();
$location_parts = explode( ',', $location );
if ( count( $location_parts ) >= 3 ) {
$city = trim( $location_parts[0] );
$district = trim( $location_parts[1] );
$location = $city . ', ' . $district;
}
?>
<div class="hp-listing__location">
<i class="hp-icon fas fa-map-marker-alt"></i>
<?php if ( get_option( 'hp_geolocation_hide_address' ) ) : ?>
<span><?php echo esc_html( $location ); ?></span>
<?php else : ?>
<a href="<?php echo esc_url( hivepress()->router->get_url( 'location_view_page', [ 'latitude' => $listing->get_latitude(), 'longitude' => $listing->get_longitude() ] ) ); ?>" target="_blank"><?php echo esc_html( $location ); ?></a>
<?php endif; ?>
</div>
<?php endif; ?>