WordPress.org

Ready to get started?Download WordPress

Forums

include tag in gallery shortcode not working (2 posts)

  1. dangadd5600
    Member
    Posted 3 years ago #

    From what I've read, WordPress supports an 'include' and 'exclude' option in the gallery shortcode. If that is correct, I should be able to write

    [gallery include="68,95"]

    in a page's html and have the photos that are attached to those two posts show up in a gallery in my page. However, as soon as I add a second number to that option, the gallery disappears from the page. I can successfully write any of the following:

    [gallery include="68"]
    [gallery include="95"]
    [gallery id="68"] or
    [gallery id="95"]

    And those will all successfully add a gallery to my page with the correct images. But as soon as I put a second number in the 'include' or 'id' attribute, the gallery is stripped from the page. I've also tried to use the 'exclude' attribute and list all galleries except the ones that I want. That doesn't work either.

    Are the include and exclude attributes no longer a part of WordPress? I'm running WordPress 3.1.

  2. akharawaka
    Member
    Posted 2 years ago #

    Having the same problem here.

    BTW, as arguments for the "include" tag, do you have to use the ID of the attachments proper, or the ID of the posts that the images are attached to ? I didn't find the codex very clear on that point.

Topic Closed

This topic has been closed to new replies.

About this Topic