I have jquery geocomplete plugin but I dont know how to use it in WordPress. I know how to use in plain php. so anyone can tell me how to use it in WordPress?? This is my code..
<form>
<input id="geocomplete" type="text" placeholder="Type in an address" size="90" />
</form>
<div class="map_canvas"></div>
<script src="http://maps.googleapis.com/maps/api/js?sensor=false&libraries=places"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="../jquery.geocomplete.js"></script>
<script src="logger.js"></script>
<script>
$(function(){
var options = {
map: ".map_canvas",
location: "NYC"
};
$("#geocomplete").geocomplete(options);
});
</script>
Place these above code in function.php
then add shortcode “[show_my_gocomplete]” to your post or pages.
other wise add shorcode to your template file
place your other js files in your theme_folder/js folder
I haven’t added jquery lib here, as its already available in wordpress.
there are some good way to implement it, like enqueue your script.