I might have found a way to insert my own customized map in the listings template (the one showing all the listings after performing a search).
But I would need a way to get all those search results (listings) in some form. What would be a code snippet to get all those listings (objects) so I can extract data from them? Similarly to $listing=\HivePress\Models\Listing::query()->get_by_id($listing_id); to get one listing object, there must be a way to get all listings from a search result.
And as a second question, when you know a listing ID, is there a way to get the listing object directly without having to perform the above query all the time?
This is the easiest way and using get_post() doesn’t make extra database queries, just converts the WordPress post object into the listing object, so you can access listing attributes like $listing->get_something();
Please also use rewind_posts(); at the end, otherwise the actual search results after the map may be affected.