How to add shortcode to template
-
Hi there,
I’m trying to use the shortcode directly on template with this code:
<?php echo do_shortcode(‘[google_map version=”classic” lang=”en” link=”yes” width=”100%” height=”240″]’.$address.'[/google_map]’); ?>
How do I use the ‘.$address.’ part of the code?
As I understand shortcodes, I can replace $address with ‘.$123 Someplace Rd.’ but this breaks the page whenever I try it, i.e.:
<?php echo do_shortcode(‘[google_map version=”classic” lang=”en” link=”yes” width=”100%” height=”240″]’.$123 Someplace Rd., Calgary, Alberta TAT 1A1.'[/google_map]’); ?>
The above breaks the page. Nothing loads and it’s blank. As soon as I add a number, it breaks.
I’m not a programmer and I’m obvious using .$address. incorrectly.
Any help would be appreciated.
Thanks
G
- The topic ‘How to add shortcode to template’ is closed to new replies.