WordPress and Google Maps

Are you having issues implementing your Google map API into WordPress?

Problem Wordpress inserts <p> tags to every line and therefore your JavaScript does not execute the way it should.

Solution(kind of) Insert <?php remove_filter (‘the_content’, ‘wpautop’); ?>? at the beginning of <?php the_content(); ?> of your template file. This will remove <p> tags on every page of your blog. This solution is not great however your Google Map API JavaScript will work.

Best Solution Download the PHP Execution plugin and install it in the plugins folder. This plugin allows you to? execute php code in your posts/pages. Once you have installed this plugin, go to your post/page and insert <?php remove_filter (‘the_content’, ‘wpautop’); ?> at the beginning or anywhere before the map JavaScript code. Then insert your Google maps API JavaScript. Your code should work as it did on a regular html page without affecting the format on other pages of your blog.

... Read More