Please correct my syntax..i'm missing something I know it..

Discussion in 'PHP' started by jeeplaw, Jan 16, 2012.

  1. #1
    I've got a shortcode call in php for wordpress and I'm trying to pass a variable but it's not working..what am I missing?

    <?php echo do_shortcode('[snap url=http://www.page1webmarketing.com alt="My description" w="200" h="300"]'); ?> <----that works fine, but I've got a variable already set to http://www.page1webmarketing.com called $hh and this doesn't work...

    <?php echo do_shortcode('[snap url=$hh alt="My description" w="200" h="300"]'); ?>

    Can someone help my syntax?
     
    jeeplaw, Jan 16, 2012 IP
  2. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    #2
    <?php echo do_shortcode('[snap url='.$hh.' alt="My description" w="200" h="300"]'); ?>
    PHP:
     
    MyVodaFone, Jan 16, 2012 IP
  3. jeeplaw

    jeeplaw Well-Known Member

    Messages:
    827
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    118
    #3
    Ahhhhh..my thanks on that..I KNEW it was something with the syntax :)
     
    jeeplaw, Jan 16, 2012 IP