Display a Google Map in a WordPress page without it breaking

If you’ve tried putting a Google map in your WordPress site’s contact page, you might have noticed that sometimes it breaks when you edit the page in visual mode later. Here’s a quick fix I just used in a site I’m working on.

This solution uses custom fields. Here’s a tutorial on custom fields in case you need it.

First, I took the code from Google Maps and put it into a custom field in my contact page.

Then I edited my theme by adding a bit of code into page.php, just after where the line which outputs my title. Yours would look something like this:
<h1>the title();</h1>

So after the title I inserted the following to get my custom field which I had called “floatright”:


$customField = get_post_custom_values("floatright");
if (isset($customField[0])) {
      echo '<div class="alignright">'.$customField[0].'</div>';
}

So basically that checks if I’ve set a value for that custom field in the current page, and if so it inserts the field wrapped in a div which is floated right.

Of course I could have just hard-coded the map into page.php when the page is “contact us”. But this is a flexible solution that could be used on other pages and for any item that we want to float over to the right. And, the client can update that map area if they want to later without breaking that wrapper HTML. If you’re savvy enough to do this on your own site you might just put the div into your custom field for even more flexibility.


Beautifully animated music video – Neko Case

I’m loving this animation, and the song is quite catchy too. Thanks to Darren’s list of newest favourite songs for the discovery.


Fun Coffee images found on Flickr

While writing about why you should probably make time for Twitter and Facebook over on the ThriveWire blog, I searched for Creative Commons licensed photos on Flickr. Here’s some of the gems I found but didn’t end up using over there.

Bright & Colourful:

Arbutus Coffee (thelastminute, flickr)

Arbutus Coffee (Duncan Rawlinson a.k.a. thelastminute, flickr)

I just love the colour and simplicity in this. (justinknol, flickr)

I just love the colour and simplicity in this. (justinknol, flickr)

In the Vintage & weird department:

Coffee + Spankings, vintage ad (seanbonner, flickr)

Coffee + Spankings, vintage ad (seanbonner, flickr)

Coffee means pleasure, coffee means fun! (cowtools, flickr)

Coffee means pleasure, coffee means fun! (cowtools, flickr)

Coffee can bring the world to you! - vintage brochure imagery from cowtools on flickr

Coffee can bring the world to you! - vintage brochure imagery (cowtools, flickr)

Dedicated to the craft

Coffee Break (scarygami, flickr)

Coffee Break (scarygami, flickr)

Old-time charm

London coffee shop from sheyne on flickr

London coffee shop (sheyne, flickr)


Barbara’s Blackberry Cobbler

There are two recipes which are famous in my family. Both came from the glorious hippie days of the early 70’s when my mom Heather and her friend Barbara lived in a shared house on the banks of the Fraser River. Between them they had 5 kids from infant to 6 years old.

So, 5 hippie kids running around half naked all summer long need a lot of entertaining, right? What better than to send them all to the blackberry bushes surrounding the back yard!

Legend has it that one entire summer was filled with us little ones picking blackberries (and no doubt eating many before they hit the bowl) while Barbara put her food sciences training to use and perfected…

Barbara’s Blackberry Cobbler

In a bowl, cream together well:

In another bowl, mix together:

Add the dry mix to the creamed butter/sugar, alternately with 1 cup fresh or sour milk

Basically you end up with a kind of white cake batter. Spread that batter in a greased 9×12 pan (Mom says glass works best, I’ve never tried metal but I could see it being harder to clean).

Finally, bake at 350 degrees about 45 minutes until brown on top.

Some of the cake will rise up between the berries, and the blackberry-water-sugar will make a kind of jelly-saucy stuff. Dee-lish.

Serve with vanilla ice cream.

Game to try it? Send me a picture of yours and I’ll post it here with a link to you, if you like. Otherwise I’ll post a photo next time I make one.

And as for that other recipe? That’s the one thing we’ll violently defend from poaching siblings around the dining table: Heather’s Cheesecake with Sour Cream Topping. You might have to talk me into sharing that one ;-)


Awesome Animation of Graffiti

I totally enjoyed this stop-motion animation made from graffiti. I think it’s one of the more brilliant pieces of art I’ve seen in a long time.

MUTO: An ambiguous animation painted on public walls

MUTO


About

Tzaddi Gordon
link to linked in profile

Zodomatica is the personal site of Tzaddi Gordon, a web designer from Roberts Creek, BC, Canada. You might not know it from this sadly neglected blog, but I'm passionate about design that balances form and function. See more about that at my company's site: ThriveWire Media.

Recently Written:

Categories

RSSSubscribe to RSS Feed
Ajax CommentLuv Enabled 0426c3732e12779a15a05c2fca63511d