I am trying to load google map on a page and I created a function loading scripts in my function php. It loads the map and OK, but I want to limit this function being loaded to a certian page.
Conditional tags do not work for me here or I don't use them properly
here is the code from function file
function my_map() {
if (!is_admin()) {
wp_deregister_script('g_map');
wp_register_script('g_map', 'http://maps.google.com/maps/api/js?sensor=false', false, '', true);
wp_enqueue_script('g_map');
wp_enqueue_script('y_map', get_bloginfo('template_url') . '/js/ymap.js', array('g_map'), '1.0', true);
}
}
add_action('init', 'my_map');
Please show me the way to do it