Categories

Featured templates

WordPress. How to add an address/text to Google map coordinator

Guillaume Dumas May 15, 2015
Rating: 5.0/5. From 3 votes.
Please wait...

This tutorial shows how to add an address or text to Google map coordinator in WordPress templates.

WordPress. How to add an address/text to Google map coordinator

In order to add a message to your google map coordinator, you should perform the following:

  1. Open up the wp-content/themes/themeXXXXX/includes/custom-function.php file and locate the following code

    var contentString = "<div></div>";

    WordPress._How_to_add_an_address_or_text_to_google_map_coordinator-1

  2. Insert your message between the div tags. You can use any HTML code inside, only make sure you escape double quotes with slashes. Also we strongly recommend adding classes to the elements you insert. It will help you style the message box. In the example below we added a paragraph with a specific class map_msg and escaped the double quotes:

    var contentString = "<div><p class=\"map_msg\">Hello, World</p></div>";

    WordPress._How_to_add_an_address_or_text_to_google_map_coordinator-2

  3. Save the changes in the custom-function.php file and upload it to the server:

  4. In different templates the default text color may differ. To set your own color and add any styling, use the class you assigned to your message HTML elements.

    In our example we change the white color to black, increase the font-size of the text and remove the bottom margin of the paragraph. In order to do that, we add the following code to the very bottom of the wp-content/themes/themeXXXXX/style.css file:

    .map_msg {
    	color: black;
    	font-size: 18px;
    	margin-bottom: 0;
    	}

    WordPress._How_to_add_an_address_or_text_to_google_map_coordinator-3

    The final result should look like this:

    WordPress._How_to_add_an_address_or_text_to_google_map_coordinator-4

Feel free to check the detailed video tutorial below:

WordPress. How to add an address/text to Google map coordinator

Best Templates for Wordpress
This entry was posted in WordPress Tutorials and tagged address, coordinator, google, map, text, WordPress. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket