I built a site using twenty twelve that is not on a live server yet, but which allows you to simply enter a street address into a custom field, and outputs a Google Map centered right on that address with a marker on the house number. It works exactly as I want it to. I did it by adding a custom field output to the iframe code:

<iframe width="300" height="300" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.ca/maps?center=<?php the_field('street_address'); ?>&q=<?php the_field('street_address'); ?>&zoom=14&size=300x300&output=embed&iwloc=near"></iframe><br />

Now I am trying to use this same code in another theme that I have developed using Wordpress and Bootstrap 3. It refuses to center properly or zoom properly. It gets sort of close, but that's useless, and it doesn't show a marker. I am assuming the problem has something to do with the fact that this is Bootstrap, but it would be helpful to me if someone could confirm that so that I can at least know I am not overlooking something obvious, and just as importantly so I can be sure my first site is not going to break for some reason because I didn't code it correctly after all. I am simply cutting and pasting the above code from my old theme to this current one. I am sure I am calling the custom field correctly.

  • the_field is not a core function, are you using that plugin in both cases? – Milo Mar 1 '14 at 20:10
  • Yes, definitely using ACF in both cases, although it occurs to me now that in the old site I am using it in a custom post type and in the new site I am using it on a page template. Not sure if that would make any difference. – MBWD Mar 2 '14 at 0:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.