Join our new community forum for support & discussion
Join NowHome › Support › Themes › TaskHive › How to add Map in Taskhive on top of the search result like Rentalhive
How to add Map in Taskhive on top of the search result like Rentalhive
-
AuthorPosts
-
fsimoni 1 year, 2 months ago
Hi Team,
Is there a way to add Map on top of the search results page like appear on Rentalhive theme?Tnx
FedericoStivi 1 year, 2 months agouse this and adjust the order/
add_filter( 'hivepress/v1/templates/listings_view_page', function( $template ) { return hivepress()->helper->merge_trees( $template, [ 'blocks' => [ 'listing_map' => [ 'type' => 'content', ], 'page_content' => [ 'blocks' => [ 'listing_map3' => [ 'type' => 'listing_map', '_order' => 1, ], ], ], ], ] ); }, 1000 );
Stivi 1 year, 2 months agoStivi 1 year, 2 months agoIn my page it is in the end, because i wanted it to be in the end, but you need to adjust the order.
Stivi 1 year, 2 months agoadd_filter( 'hivepress/v1/templates/listings_view_page', function( $template ) { return hivepress()->helper->merge_trees( $template, [ 'blocks' => [ 'listing_map' => [ 'type' => 'content', ], 'page_content' => [ 'blocks' => [ 'listing_map3' => [ 'type' => 'listing_map', 'attributes' => [ 'id' => [ 'map' ], ], '_order' => 1, ], ], ], 'page_topbar' => [ 'blocks' => [ 'custommaps' => [ 'type' => 'content', 'content' => '<a href="#"><i class="hp-icon fas fa-map"></i><span>Show Map</span></a> <script> function myFunction() { var x = document.getElementById("map"); if (x.style.display === "block") { x.style.display = "none"; } else { x.style.display = "block"; } } </script>', '_order' => 15, ], ], ], ], ] ); }, 100 );
Stivi 1 year, 2 months agothis is the code
Stivi 1 year, 2 months agoWell it must work:
Try this:#map{ display:none!important; }
This code hides the map in order for the toggle to be hidden, and on click to activate.
Stivi 1 year, 2 months agoSoyy, didnt copy the hole code:
add_filter( 'hivepress/v1/templates/listings_view_page', function( $template ) { return hivepress()->helper->merge_trees( $template, [ 'blocks' => [ 'listing_map' => [ 'type' => 'content', ], 'page_content' => [ 'blocks' => [ 'listing_map3' => [ 'type' => 'listing_map', 'attributes' => [ 'id' => [ 'map' ], ], '_order' => 1, ], ], ], 'page_topbar' => [ 'blocks' => [ 'custommaps' => [ 'type' => 'content', 'content' => '<a href="#"><i class="hp-icon fas fa-map"></i><span>Show Map</span></a> <script> function myFunction() { var x = document.getElementById("map"); if (x.style.display === "block") { x.style.display = "none"; } else { x.style.display = "block"; } } </script>', '_order' => 15, ], ], ], ], ] ); }, 100 );
Stivi 1 year, 2 months agoadd_filter( 'hivepress/v1/templates/listings_view_page', function( $template ) { return hivepress()->helper->merge_trees( $template, [ 'blocks' => [ 'listing_map' => [ 'type' => 'content', ], 'page_content' => [ 'blocks' => [ 'listing_map3' => [ 'type' => 'listing_map', 'attributes' => [ 'id' => [ 'map' ], ], '_order' => 1, ], ], ], 'page_topbar' => [ 'blocks' => [ 'custommaps' => [ 'type' => 'content', 'content' => '<a onclick="myFunction()" class="hp-link--hide-map hp-link" data-toggle="map" href="#" data-component="toggle" data-url="" data-icon="map" data-caption="Mbyll Harten" data-state=""><i class="hp-icon fas fa-map"></i><span>Shfaq Harten</span></a> <script> function myFunction() { var x = document.getElementById("map"); if (x.style.display === "block") { x.style.display = "none"; } else { x.style.display = "block"; } } </script>', '_order' => 15, ], ], ], ], ] ); }, 100 );
-
AuthorPosts
Viewing 16 posts - 1 through 16 (of 16 total)
New Reply
This forum has been archived and is no longer accepting new posts or replies. Please join our new community forum for support & discussion.