Support » Plugin: Flickr Gallery » [Plugin: Flickr Gallery] How to pass variables & do_shortcode

  • prae5

    (@prae5)


    Using the plugin and it works great in pages and posts 🙂

    I’m putting together a few post templates and am having a few issues passing variables to the plugin. I want to pass a a list of tags to it, but can’t seem to work out how to do it.

    Can I reference the plugin using a php function (i can’t find anything) or is it just the shortcode available?

    This is what I’m currently trying to do – if anyone has better suggestions I’m open to them…..

    This works:

    <?php
     echo do_shortcode('[flickr-gallery mode=tag tags=MYTAGS tag_mode=all]');
    ?>

    Taking this a step further I want to pass a list of tags to the shortcode, but it doesn’t work:

    <?php
    $myTags="MYTAGS";
    echo do_shortcode('[flickr-gallery mode=tag tags=$myTags tag_mode=all]');
    ?>

    All help and suggestions appreciated 🙂

    thanks

    http://wordpress.org/extend/plugins/flickr-gallery/

Viewing 1 replies (of 1 total)
  • prae5

    (@prae5)

    OK, this sort of works – but the plugin only seems to use the first item passed.

    echo do_shortcode('[flickr-gallery mode=tag tags="'.$myTags.'" tag_mode=all]'); ?>

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Flickr Gallery] How to pass variables & do_shortcode’ is closed to new replies.