Jim Kite

Unregistered less info
3 reputation
1
bio website
location
age
visits member for 1 year, 6 months
seen Oct 9 '12 at 19:04

Oct
8
awarded  Scholar
Oct
8
accepted Using do_shortcode with variables?
Oct
8
comment Using do_shortcode with variables?
That was my stupidity. Your code worked perfectly. I didn't check the postal code entered in the testing post was correct, and it must have been producing a conflict with the address and thus not returning a map at all. Thanks so much for the help and apologies for the mistake.
Oct
7
comment Using do_shortcode with variables?
Doing print_r ($address); right before the echo do_shortcode showed the address.
Oct
7
comment Using do_shortcode with variables?
The percentage mark change doesn't seem to have made any difference as far as I can see. It still doesn't return anything to the page. Was I correct to be declaring the variables before this code?
Oct
7
comment Using do_shortcode with variables?
Thanks very much for the welcome and for your help. This is quite the resource - I'm amazed. The shortcode is generated by a plugin called simple google maps short code wordpress.org/extend/plugins/simple-google-maps-short-code.
Oct
7
comment Using do_shortcode with variables?
Oops. How does one format code blocks in comments?
Oct
7
comment Using do_shortcode with variables?
It doesn't seem to return anything (I think because it doesn't have values for any of those variables). I edited like so: <?php $address = get_field('cong_streetaddress'); $city = get_field('cong_city'); $province = get_field('cong_province'); $postalcode = get_field('cong_postalcode'); $shortcode = sprintf( '[pw_map address="%1$s %2$s %3$s %4$s" width="100%" height="200px"]', $address, $city, $province, $postalcode ); echo do_shortcode( $shortcode ); ?> but that didn't work either.
Oct
7
asked Using do_shortcode with variables?