Now that it was working, my husband wanted to integrate it into his website (built on WordPress) documenting everything else about Toynbee Tiles. Great – so I ftp’ed everything onto his site. Within the map site, everything worked great. But clicking to return to the main site made the page hang. I spent an hour researching this, and finally found that the beloved & hated
$ character isn’t recognized as such by WordPress. What to do? Pass it to your function by explicitly calling jQuery.
So if your old function looked like this:
Your new function should look like this:
Really. That’s it. And your jQuery site will play nice with your WordPress site. A few other pitfalls we ran into as we developed this site… the
.htaccess file contained some redirect settings. These need to go at the beginning of the file – otherwise you’ll be stuck in an infinite loop. Also, if this map template links back to a WordPress site, consistency of the
www. at the beginning of the url is crucial between code in the map, WordPress settings, and your domain/host’s settings. Otherwise you’ll get a
'Access-Control-Allow-Origin' error and won’t be able to link from the map template to the wordpress site.