2009.06.19

Finding Lattitude and Longitude on Google Maps

By underblob @ 10:21am — Categories: Javascript, Tech

Here is an easy little trick to extrapolate the latitude and longitude coordinates from Google Maps. The coordinates reflect the center of the map so make sure that you have your location centered first. Once you have it all lined up, paste this code into the address bar of your browser:

javascript:void(prompt(”,gApplication.getMap().getCenter()));

Brilliant!

Links

www.tech-recipes.com/google_maps_get_latitude_longitude_values/

2009.06.12

Adding <head> Files in a WordPress Template

By underblob @ 5:59am — Categories: Tech, WordPress

Problem: want to create a WP Template that uses a different CSS file from the Theme CSS so that the HTML structure remains the same but the Template layout will be different, dictated by the CSS. It works to put a <link> to the CSS in the Template HTML but then it gets rendered in <body> instead of the <head>, which is a little wonky. How to get the CSS into the <head>?

Solution: Insert this PHP code into the beginning of your Template file before the get_header() call…

<?php
function mytemplate_head () {

echo ‘<link rel=”stylesheet” type=”text/css” href=”‘ . get_bloginfo(‘template_directory’) . ‘/mytemplate.css” />’;

}
add_action ( ‘wp_head’, ‘mytemplate_head’ );
?>

Links

get_bloginfo
add_action
get_header