WordPress.org

Ready to get started?Download WordPress

Forums

Gallery short tag - "exclude" argument (9 posts)

  1. Michael Fields
    Themer
    Posted 6 years ago #

    Hi.

    Really digging the new gallery short tag feature in 2.5. One thing does bother me about it though, What if you want to exclude some attachments from the gallery? How would you go about doing this. In my blog, I would like to upload images to the post, add some images to the content, and then have the remaining images show up in the gallery below. Is this possible with the current version? Is it being considered for new releases?

    Thanks to anyone who knows anything about this,

    btw - If we could get the right-hand sidebar back in the write post screen - that would SERIOUSLY rock :)

  2. Michael Fields
    Themer
    Posted 6 years ago #

    I guess no one knows anything about this....

    I played around with the new shortcode api and made a simple plugin that accomplishes what I need it to. I sets a param to the [gallery] short tag which will allow a user to include a comma separated list of attachment id's.

    Check it out and let me know what you think.

  3. karl19
    Member
    Posted 6 years ago #

    Yes, it would be great if there was a setting saying "if image is already used in post, don't show in gallery". We use a number of images for longer articles and there's no need to repeat them amongst other images in a potential gallery at the end.

  4. Michael Fields
    Themer
    Posted 6 years ago #

    karl19,
    Try this: mf_gallery_shortcode()

    it's a fix that I came up with :)

  5. BioTecK
    Member
    Posted 6 years ago #

    Hello mfields,

    Nice plugin! Only when I activate the plugin and use the [galley ids="12,43"] I get "Missing Attachment". What do I do wrong!

  6. ladydelaluna
    Member
    Posted 6 years ago #

    This would be perfect if it had an "exclude" parameter somehow. (Unfortunately I'm no plugin pro, so I couldn't figure it out myself.)

    Example, I have written a post that has 12 images I want in the gallery, and one which I want to use later in the post, NOT in the gallery. Rather than having to include the id numbers for 12 images, it’d be much easier to exclude just one id number…

  7. mmartinez
    Member
    Posted 5 years ago #

    I GOT IT!!!!

    Man, I've had the same problem for soo effing long it's ridiculous. But I just sorta made up a code based on what I know of regular HTML coding and it actually worked.

    So here it is:

    Let's say you post four photos and then want to include the [MORE] code to cut the post in half and add the [GALLERY] code after the jump.

    What you would do is put this code around the photos you don't want to repeat.

    <no repeat>PHOTOS</no repeat>

    It's the same concept behind doing bold and underline or italic codes (<b>sample wording</b>, <u>sample wording</u>, <i>sample wording</i>).

    I did that and the photos didn't repeat. FINALLY!

    Hope this helps!!

    =)

  8. mmartinez
    Member
    Posted 5 years ago #

    Nevermind. It didn't work. It still repeated them. Dammit!!! Back to the drawing board. I wish someone posted the answer. Boo. =(

  9. flavio
    Member
    Posted 5 years ago #

    You can use the exclude function that the plugin mf_gallery_shortcode() provides

Topic Closed

This topic has been closed to new replies.

About this Topic