This is great! Thank you for sharing!! Would it be possible to add a parameter for a static map?
It probably would, and I can see how useful it would be (the relationship of one map per page or post that the plugin imposes may be useful in some circumstances, but other times multiple maps on a page would be very handy.
It would probably need some changes in the core plugin though, because only the width and height are accepted as parameters in the pronamic_google_maps() function.
Another approach could be to put maps into hidden posts, and pass the post ID as a parameter. That way there is not too much work involved having to extend the parameters to include everything you may possibly need in a map (title, name, coords, addresss…). A post type called “maps” would work, though making post types that WordPress does not automatically index and make available to the world is a pain.
Anyway, there are some ideas, so hopefully they will land on the right lap for some implementation π
@judgej #post-2189771
In version 2.0 the shortcode [google-maps] will be available.
The plugin is using the default embed width and height wich you can configure in WordPress (Settings Β» Media).
There are ofcourse attributes available:
[google-maps width=300 height=200 static=true label=M]
@judgej #post-2211892
You could also use the Pronamic Google Maps widget to add maps that are not related to posts.
@judgej: Thanks for sharing your solution with us.
@remco Tolsma: Thanks for the update! Is there an expected date of release for v2.0?
@flick We will launch version 2.0 this week.
@judgej: I copied your code in the theme’s functions php and I got:
Parse error: syntax error, unexpected T_STRING in /home1/paginapa/public_html/armariodemaria/wp-content/themes/Suerte-1.1/includes/functions.php on line 144
π ?? can you or somebody else tell me what’s going on, where’s the problem
thanx
Aldin
There is a syntax error on line 144 of includes/functions.php That is where you need to look first.
yeah, I understood that, but the only thing I did was paste your code there, so there must be an error in the code?
There is certainly an error in the code that was pasted, on line 144. We can’t tell you what that could be, because we can’t see line 144. We have no idea what line 144 is. Perhaps with some clues, we could help.
well, now I just get the error message, can’t even get into my dashboard π
is there something I can do beside reinstall the whole site?
If all you have changed is functions.php, then just restore that file back to the original copy. If you didn’t take a backup before fiddling with it, then extract it from the zip file of the WordPress version you installed originally.
I didn’t make a back up and I have no idea where to find that zip file π I installed WP with Fantastico.
@aldin30 did you solve the problem? If not could you send us our functions.php theme file?
hi Remco,
I payed someone on fiverr and they managed to get rid of the problem, so I can log in to my page but I don’t want to mess with the code anymore, so I’m just gonna skip the map