• Resolved John O

    (@jossoway)


    Hi,

    I hope someone can point me in the right direction with this. I am trying to include a wordpress gallery in a page using the do_shortcode method described on this page:

    http://codex.wordpress.org/Gallery_Shortcode

    The problem I am having is that whichever way I write the code, it only seems to accept the last parameter and ignores everything else. The example below includes the correct gallery. sets the link to be a file, but ignores my column setting and includes all images attached to the post, rather than the ones I have specified. I’ve tried re-ordering the parameters, and it always obeys the last one, but none of the preceding ones.

    <?php
    echo do_shortcode('[gallery include="68,67,66,65,64,63", columns="2", link="file"]');
    ?>

    Can anyone point me to where I am going wrong? Thanks.

    John
    :-/

Viewing 4 replies - 1 through 4 (of 4 total)
  • David Choi

    (@wpthemes777)

    Are you inserting that code into functions.php or template file? If not, then just insert

    [gallery include="68,67,66,65,64,63", columns="2", link="file"]

    into page’s editor (text tab, not visual tab).

    Thread Starter John O

    (@jossoway)

    Hi – it’s in a template, otherwise yes, I’d just use the method you described.

    Michael

    (@alchymyth)

    try without the excess kommas (untested);

    http://codex.wordpress.org/Gallery_Shortcode

    <?php
    echo do_shortcode('[gallery include="68,67,66,65,64,63" columns="2" link="file"]');
    ?>
    Thread Starter John O

    (@jossoway)

    It works – thanks!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Problems with gallery shortcode in template’ is closed to new replies.