GeoDirectory SupportMap instead of Flexislider on Detail page – GeoDirectory Support https://wpgeodirectory.com/support/topic/map-instead-of-flexislider-on-detail-page/feed Wed, 14 Jan 2026 04:46:15 +0000 http://bbpress.org/?v=2.5.14-6684 en-US https://wpgeodirectory.com/support/topic/map-instead-of-flexislider-on-detail-page/#post-12623 <![CDATA[Map instead of Flexislider on Detail page]]> https://wpgeodirectory.com/support/topic/map-instead-of-flexislider-on-detail-page/#post-12623 Tue, 19 Aug 2014 22:43:10 +0000 Dave C Hi, I’m not really using the photos feature often, and think it would be much more useful for my test site to display the map instead of the flexislider on the details page. I’ve scoured the forum and gone through the code but can’t seem to find an easy way to do this? Perhaps some of the wizards here can help?

]]>
https://wpgeodirectory.com/support/topic/map-instead-of-flexislider-on-detail-page/#post-12651 <![CDATA[Reply To: Map instead of Flexislider on Detail page]]> https://wpgeodirectory.com/support/topic/map-instead-of-flexislider-on-detail-page/#post-12651 Wed, 20 Aug 2014 11:13:21 +0000 Guust I’ll alert the wizards for you 🙂

]]>
https://wpgeodirectory.com/support/topic/map-instead-of-flexislider-on-detail-page/#post-12681 <![CDATA[Reply To: Map instead of Flexislider on Detail page]]> https://wpgeodirectory.com/support/topic/map-instead-of-flexislider-on-detail-page/#post-12681 Wed, 20 Aug 2014 14:49:41 +0000 Stiofan O'Connor So from my reading i think you wnat to remove the slider and place the map there instead?

#1 remove the slider, add this code to your child theme functions.php

remove_action( 'geodir_details_main_content', 'geodir_action_details_slider',30);

That’s the easy bit over, now on to the hard bit.

You need to move the map into that position so we add this code.


add_action( 'geodir_details_main_content', 'geodir_action_details_map_replace_slider',30);

function geodir_action_details_map_replace_slider(){
	global $post,$post_images,$video,$special_offers, $related_listing,$geodir_post_detail_fields;
	$map_args = array();
		$map_args['map_canvas_name'] = 'detail_page_map_canvas2' ;
		$map_args['width'] = '600';
		$map_args['height'] = '300';
		if($post->post_mapzoom){$map_args['zoom'] = ''.$post->post_mapzoom.'';}
		$map_args['autozoom'] = false;
		$map_args['child_collapse'] = '0';
		$map_args['enable_cat_filters'] = false;
		$map_args['enable_text_search'] = false;
		$map_args['enable_post_type_filters'] = false;
		$map_args['enable_location_filters'] = false;
		$map_args['enable_jason_on_load'] = true;
		$map_args['enable_map_direction'] = true;
		geodir_draw_map($map_args);
}

Some CSS may be required but that’s basically it.

Stiofan(the wizard)

]]>
https://wpgeodirectory.com/support/topic/map-instead-of-flexislider-on-detail-page/#post-21611 <![CDATA[Reply To: Map instead of Flexislider on Detail page]]> https://wpgeodirectory.com/support/topic/map-instead-of-flexislider-on-detail-page/#post-21611 Sat, 15 Nov 2014 13:00:03 +0000 Fearless_Shultz Hi There, I am trying to do something quite similar but rather than replace the slider, I am wanting to move the map to a different area as I don’t want to use the tabs. I have implemented the code code above with the slight modification of trying to remove map in tabs and wrapping the new map in a div.

The new map is showing in the position that I want it to, but with a grey overlay and a loading icon which never finishes. The map is still showing in the tabs area but in the same state.

Looking in Chrome developer tools, I get the following errors related to the map:

You have included the Google Maps API multiple times on this page. This may cause unexpected errors

Uncaught InvalidValueError: setMap: not an instance of Map; and not an instance of StreetViewPanorama

These would make sense as there are two versions of the map on the page, but I am not too sure how to target removing the one in tabs.

Below is the code I am using in functions.php



remove_action( 'geodir_details_main_content', 'geodir_action_details_map',30);

function geodir_action_details_map_replace_slider(){
	global $post,$post_images,$video,$special_offers, $related_listing,$geodir_post_detail_fields;
	$map_args = array();
		$map_args['map_canvas_name'] = 'detail_page_map_canvas2' ;
		$map_args['width'] = '100%';
		$map_args['height'] = '300';
		if($post->post_mapzoom){$map_args['zoom'] = ''.$post->post_mapzoom.'';}
		$map_args['autozoom'] = false;
		$map_args['child_collapse'] = '0';
		$map_args['enable_cat_filters'] = false;
		$map_args['enable_text_search'] = false;
		$map_args['enable_post_type_filters'] = false;
		$map_args['enable_location_filters'] = false;
		$map_args['enable_jason_on_load'] = true;
		$map_args['enable_map_direction'] = true;
		echo '<div id="detailMapContainer">';
		geodir_draw_map($map_args);
		echo '</div>';
}

add_action( 'geodir_details_main_content', 'geodir_action_details_map_replace_slider',30);
]]>
https://wpgeodirectory.com/support/topic/map-instead-of-flexislider-on-detail-page/#post-21612 <![CDATA[Reply To: Map instead of Flexislider on Detail page]]> https://wpgeodirectory.com/support/topic/map-instead-of-flexislider-on-detail-page/#post-21612 Sat, 15 Nov 2014 13:00:44 +0000 Fearless_Shultz https://wpgeodirectory.com/support/topic/map-instead-of-flexislider-on-detail-page/#post-21613 <![CDATA[Reply To: Map instead of Flexislider on Detail page]]> https://wpgeodirectory.com/support/topic/map-instead-of-flexislider-on-detail-page/#post-21613 Sat, 15 Nov 2014 13:13:00 +0000 Guust Do you still have that problem once you tidy up your locations?
http://docs.wpgeodirectory.com/faqs/how-do-i-merge-locations/
For example you have a country called “all” in your database.

]]>
https://wpgeodirectory.com/support/topic/map-instead-of-flexislider-on-detail-page/#post-21614 <![CDATA[Reply To: Map instead of Flexislider on Detail page]]> https://wpgeodirectory.com/support/topic/map-instead-of-flexislider-on-detail-page/#post-21614 Sat, 15 Nov 2014 13:25:17 +0000 Fearless_Shultz Hi Guust, this was one of the points I was going to ask about next although I didn’t think it would be related to this and more the fact that there are two map instances on the page.

The locations have gotten into a bit of a mess as we have had an external data entry person adding listings. I will go and merge the locations and see if that makes a difference.

I just want to confirm that I won’t be at risk of deleting any listings by doing this?

Many thanks

Mike

]]>
https://wpgeodirectory.com/support/topic/map-instead-of-flexislider-on-detail-page/#post-21615 <![CDATA[Reply To: Map instead of Flexislider on Detail page]]> https://wpgeodirectory.com/support/topic/map-instead-of-flexislider-on-detail-page/#post-21615 Sat, 15 Nov 2014 13:57:32 +0000 Guust If you MERGE locations, you will not loose any listings, but if you DELETE a location then you will also delete all listings in that location.

You can’t have 2 identical maps on the same page, but you can have the listing map to the detail page, http://www.bookhinterland.com.au/accommodation/julies-retreat/

]]>
https://wpgeodirectory.com/support/topic/map-instead-of-flexislider-on-detail-page/#post-21616 <![CDATA[Reply To: Map instead of Flexislider on Detail page]]> https://wpgeodirectory.com/support/topic/map-instead-of-flexislider-on-detail-page/#post-21616 Sat, 15 Nov 2014 14:15:49 +0000 Fearless_Shultz Hi Guust,

I have merged the locations. Please let me know if they look ok now.

The problem still exists though, even if I remove the custom action to add the map below the tabs box. So can you see anything else that is wrong?

Also, just to confirm, I don’t want two maps on the page, I just want one that appears outside of the tabbed area which I have partly done but as mentioned, neither that nor the map in the tabbed area are fully loading. Also for some reason, the map in the tabbed area is zoomed out to show a much larger area than just the intended one.

]]>
https://wpgeodirectory.com/support/topic/map-instead-of-flexislider-on-detail-page/#post-21630 <![CDATA[Reply To: Map instead of Flexislider on Detail page]]> https://wpgeodirectory.com/support/topic/map-instead-of-flexislider-on-detail-page/#post-21630 Sat, 15 Nov 2014 21:04:37 +0000 Paolo Hi,

taking Stiofan’s example and modifying it, without actually looking at the original code will not work.

remove_action( 'geodir_details_main_content', 'geodir_action_details_map',30);

will do nothing because function geodir_action_details_map doesn’t exist. Priority 30 is assigned to slider.

The map is called with the tabs, so you should start by removing the tab.

Here is explained how to manipulate the tabs array:

https://wpgeodirectory.com/support/topic/exclude-selected-tabs-from-detail-page-if-empty/#post-7305

Once the tab for the map has been removed you will need part of the function of Stiofan to add it back, but you will have to add it correctly.

In your function you were trying to add it where the slider is, which you had not removed and that cannot work.

Actions of the detail page are:



add_action( 'geodir_details_main_content', 'geodir_action_before_single_post',10);
add_action( 'geodir_details_main_content', 'geodir_action_page_title',20);
add_action( 'geodir_details_main_content', 'geodir_action_details_slider',30);
add_action( 'geodir_details_main_content', 'geodir_action_details_taxonomies',40);
add_action( 'geodir_details_main_content', 'geodir_action_details_micordata',50);
add_action( 'geodir_details_main_content', 'geodir_show_detail_page_tabs',60);
add_action( 'geodir_details_main_content', 'geodir_action_after_single_post',70);
add_action( 'geodir_details_main_content', 'geodir_action_details_next_prev',80);

Something like this should work.



add_action( 'geodir_details_main_content', 'geodir_action_details_map_in_content',65);

function geodir_action_details_map_in_content(){
	global $post,$post_images,$video,$special_offers, $related_listing,$geodir_post_detail_fields;
	$map_args = array();
		$map_args['map_canvas_name'] = 'detail_page_map_canvas2' ;
		$map_args['width'] = '600';
		$map_args['height'] = '300';
		if($post->post_mapzoom){$map_args['zoom'] = ''.$post->post_mapzoom.'';}
		$map_args['autozoom'] = false;
		$map_args['child_collapse'] = '0';
		$map_args['enable_cat_filters'] = false;
		$map_args['enable_text_search'] = false;
		$map_args['enable_post_type_filters'] = false;
		$map_args['enable_location_filters'] = false;
		$map_args['enable_jason_on_load'] = true;
		$map_args['enable_map_direction'] = true;
		geodir_draw_map($map_args);
}

I haven’t tested it, so let us know.

Thx

]]>