Display a post map on a blank/new page

After some more Googling… New single.php looks like this: <?php get_header(); global $wp_query; if ( ! isset( $wp_query->query_vars[‘map’] ) ) { if (have_posts()) : while (have_posts()) : the_post(); the_title(); the_content(); endwhile; endif; ?> <p><a href=”https://wordpress.stackexchange.com/questions/31442/<?php echo get_permalink(); ?>?map=yes”>Map</a></p> <?php } else { ?> <div id=”map-canvas”></div> <?php } get_footer(); And functions.php like this: add_filter(‘query_vars’, ‘parameter_queryvars’ ); … Read more

Google Map Latitude and Longitude values in form

Take a look at this I did for a client: http://lpoc.co.uk/properties-for-sale/ A user can click the map and choose where to search. When a user clicks it updates a couple of hidden fields. Feel free to look at the source code to see how its done. If you want a more in depth description of … Read more

I need to get an array from the wordpress database

Is this what you are asking for? Use it after the code you posted to create posts in loop and use thier ids to update meta fields. Replace “post_type” with your custom post type. foreach ($markers as $marker){ $post_id = wp_insert_post(array( “post_title” => “something”, “post_type” => “your-type”, “post_status” => “publish”, //by default they are drafts … Read more

How to display Unicode correctly?

I’m not sure whether you are using a plugin, or you are coding it yourself. Either way, you can use server side or client side to decode or encode your content. PHP offers the utf8_decode(); and utf8_encode(); functions, that can be used to decode or encode your content before sending it to the browser, or … Read more

Putting PHP variables into javascript [duplicate]

Use wp_localize_script: wp_enqueue_script(‘YOUR_SCRIPT_HANDLE’); $object = array( ‘zoom’ => get_option(‘map_zoom’), ‘longitude’ => get_option(‘map_longitude’), ‘latitude’ => get_option(‘map_latitude’), ); wp_localize_script(‘YOUR_SCRIPT_HANDLE’, ‘JSObject’, $object); And then use it in your JS file like JSObject.zoom and the like.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)