Hi krm218,
I’ll need to ask my developer how to handle that. Let me get back to you.
OK, I heard back from him about it…
The Google Maps module doesn’t have a public API so there’s no function you can call to “insert” the map into a page. The module hooks into actions/filters that are only part of our views and the whole system “assumes” things that aren’t going to be present in a different template.
I’m not sure if the customer here is customizing the “single” template for the CPT itself or the “businessdirectory-single” template from our customization guide. I’m asking because the latter doesn’t have a way to change the location of the maps (maps are added by PHP code, not inside the template) and the former doesn’t have the hooks ours have.
If he’s using the CPT template an alternative, for now, would be to add the following to the custom template:
<?php
echo apply_filters( 'wpbdp_listing_view_after', '', get_the_ID(), 'single' );
?>
The problem with that is that it not only adds the Map but other things we might need to display such as attachments or the ratings form.
To fix this, we have to do some internal work on the plugin to really address our CPT status that isn’t exactly what WP expects. It’s something we can do in the future and soon, but it’s not present today
I hope that helps a bit… Let me know if you run into any more issues.
Thread Starter
krm218
(@krm218)
Thank you.
I am using the businessdirectory-single template.
businessdirectory-listing.tpl.php
how would I move it around within this php page?
Thread Starter
krm218
(@krm218)
So the code
<?php
echo apply_filters( 'wpbdp_listing_view_after', '', get_the_ID(), 'single' );
?>
does work but the map is still being displayed at the bottom, so now there is 2 maps.
How can I delete the one in the bottom? I turned off the google map and tried some other options but if I take it off, both maps get deleted.
Thanks in advance
Hi krm218,
Sorry for any confusion–My developer noted above, although it was easy to miss, that you aren’t currently able to place the map in a specific element within your DOM of the HTML, per this comment:
the (businessdirectory-listing.tpl.php) doesn’t have a way to change the location of the maps (maps are added by PHP code, not inside the template)
That’s a limit we are going to address, but we need to release our theme support for BD before we can really get to that and some other important fixes.
As for deleting the one on the bottom, you may be better off trying to use display:none in CSS to hide it instead. Deleting it from the DOM would be trickier.