How to change contact page Google Maps Layout

Latest Reply from coenmeinema at 2014-12-12 13:24:37 Solution
Hi all,

I'd like to change the position and width of the google maps input on the contacts page.
I like the map to be square, 300x300 px.
The position i want it to have is centered.

Can anyone tell me how, and where, to change this?



To fix this you have to edit the code:
.googlemap {
border: 1px solid #CDCAB9;
width: 300px; //add this
margin: 0 auto; //and this

It is located inside style.css.
Moreover, you have to change the following code:
function addGMap($atts, $content = null) {

extract(shortcode_atts(array( "addr" => '', "mzoom" => '16' ), $atts));
return "
<div class='googlemap'><div id='".$id."' style='width: 300px; height: 300px;'></div></div>
<script>jQuery(function(){loadGMap('".$addr."', '".$id."', ".$mzoom.", '".$content."')});</script>


You can set map width here - in the functions.php file located in the directory of the theme.
That worked, thanks!

Leave a reply

Add codeAdd image