# How to override map template

**URL:** <https://community.hivepress.io/t/how-to-override-map-template/11576>\
**Category:** Geolocation\
**Tags:** geolocation, code\
**Created:** [July 17, 2024, 9:05am UTC](https://community.hivepress.io/t/how-to-override-map-template/11576 "2024-07-17T09:05:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![WMConcept](https://community.hivepress.io/letter_avatar_proxy/v4/letter/w/b9bd4f/32.png) [@WMConcept](https://community.hivepress.io/u/WMConcept)\
**Post date:** [July 17, 2024, 9:05am UTC](https://community.hivepress.io/t/how-to-override-map-template/11576/1 "2024-07-17T09:05:20Z")

</div>

I tried to override this template : www/wp-content/plugins/hivepress-geolocation/includes/templates/class-listing-map-block.php

I add in the chide theme : www/wp-content/themes/renthalhive-child/plugins/hivepress-geolocation/includes/templates/class-listing-map-block.php

I also tried like this : www/wp-content/themes/renthalhive-child/hivepress-geolocation/includes/templates/class-listing-map-block.php

Any guidance on how to override this correctly ?

---

<div class="post-metadata">

**Author:** ![andrii](https://community.hivepress.io/user_avatar/community.hivepress.io/andrii/32/2951_2.png) [@andrii](https://community.hivepress.io/u/andrii)\
**Post date:** [July 18, 2024, 11:42am UTC](https://community.hivepress.io/t/how-to-override-map-template/11576/5 "2024-07-18T11:42:48Z")

</div>

Hi,

Everything in includes will not be overwritten, only what you overwrite in template parts. Also, this is not a template part, so you need to do everything using the hook: `hivepress/v1/templates/listing_map_block`. You can check this samples: [Search · user:hivepress template · GitHub](https://gist.github.com/search?q=user%3Ahivepress+template&ref=searchresults)  
Also, please check this doc: [How to override template parts - HivePress Help Center](https://help.hivepress.io/article/155-how-to-override-template-parts)

​I hope this is helpful to you.

---

<div class="post-metadata">

**Author:** ![WMConcept](https://community.hivepress.io/letter_avatar_proxy/v4/letter/w/b9bd4f/32.png) [@WMConcept](https://community.hivepress.io/u/WMConcept)\
**Post date:** [July 18, 2024, 1:43pm UTC](https://community.hivepress.io/t/how-to-override-map-template/11576/6 "2024-07-18T13:43:44Z")

</div>

Thanks, it’s working.

I was able to create this snipped :

```auto
add_filter(
    'hivepress/v1/templates/listing_map_block',
    function( $template ) {
        return hivepress()->helper->merge_trees(
            $template,
            [
                'blocks' => [
                    'listing_container' => [
                        'blocks' => [
                            'listing_title' => [
                                'blocks' => [
                                    'listing_title_image' => [
                                        'type' => 'part',
                                        'path' => 'listing/view/block/listing-image',
                                        '_order' => 30,
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ]
        );
    },
    1000
);

```

Might be not the best one as I’m not developper but it’s working. You may adjust and add on Github.  
It displays the image on the map :

 ![image](https://community.hivepress.io/uploads/default/original/2X/6/697d8ff46cc22f4226f293c41555a041a4a1c324.jpeg)

---

<div class="post-metadata">

**Author:** ![system](https://community.hivepress.io/user_avatar/community.hivepress.io/system/32/13990_2.png) [@system](https://community.hivepress.io/u/system)\
**Post date:** [August 17, 2024, 1:44pm UTC](https://community.hivepress.io/t/how-to-override-map-template/11576/7 "2024-08-17T13:44:38Z")

</div>

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