• I have some post that have postal address in custom fields: address , city, state and zip. How can I put a Google Maps (php)code in the template using these custom fields ? Thanks very much in advance.

Viewing 1 replies (of 1 total)
  • Thread Starter netbie

    (@netbie)

    Thank you, I have made some research and I have found it.

    In my case:

    <iframe width=”400″ height=”300″ frameborder=”0″ scrolling=”no” marginheight=”0″ marginwidth=”0″ src=”https://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=&lt;?php if ( function_exists(‘get_custom_field_value’) ){
    get_custom_field_value(‘address’, true);
    } ?><?php
    foreach((get_the_category()) as $category) {
    echo $category->cat_name . ‘ ‘;
    }
    ?><?php if ( function_exists(‘get_custom_field_value’) ){
    get_custom_field_value(‘zip’, true);
    } ?> <?php if ( function_exists(‘get_custom_field_value’) ){
    get_custom_field_value(‘state’, true);
    } ?>;t=m&z=14&iwloc=A&output=embed&iwloc=near”></iframe>

Viewing 1 replies (of 1 total)
  • The topic ‘Google Maps code and Custom Fields’ is closed to new replies.