How to render the geolocation map in a custom template inline in the code?

Hi,
How to render the geolocation map in a custom template inline in the code ?
I tried this code which seemed to me right according to the dev docs but unfortunately not showing any HTML

echo ( new \HivePress\Blocks\Listing_Map([
    'model' => 'listing'
]) )->render();

Plz help

The listing map block is needed to have the WP_Query data to get information about a listing or listings to show them. So, please make sure that your custom template has such data

Hi @yevhen and thank you for your response
The listing variable is already present in the context and it’s not showing anything !

The listing map block has a loop with have_posts() WordPress function. So it checks if there are any posts in WP_Query. Please make sure that you have correctly added this data to your custom page. Please note that it can require advanced customization. If you are not familiar with ht code customization then please consider hiring someone for custom work https://fvrr.co/32e7LvY

1 Like

Great thanks,
I think I will need a custom solution instead

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