Support » Fixing WordPress » wordpress 2.5 gallery from other posts

  • I love the new gallery feature in WP 2.5, but I was wondering if anyone knows a way that I could build galleries using images from other posts (i.e. the ones in the image library)?

    Basically, I’d like to do a weekly recap gallery of my favorite posts, and each thumbnail could be pulled into a gallery which would link back to the original posts. I know I can do this manually with the image browser, but that doesn’t automatically arrange the images or add captions.

Viewing 15 replies - 1 through 15 (of 19 total)
  • technabob,
    Hi, was wanted something similar, but got no replies. If you are php savy, the new WordPress short code api is pretty nice imho and easy to work with to boot. I was able to overwrite the functionality of the [gallery] short tag in about 20 minutes.

    I came up with a simple plugin that I think both of us ( and probably others ) will benefit from. right now, you can get it in the code bin. GPL – no warranty 🙂

    Basically, it preserves all functionality of the original [gallery] tag plus it adds one more attribute: “ids” which is a comma separated string of attachment ids for the images that you want included in the gallery.

    Example usage: [gallery ids="42,43"]

    This should get you started on your weekly recap and will definately help me out.

    Please let me know how this works for you,
    -Mike

    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!

    I’ve only received this error when the ID that I entered was not a valid attachment ID. Please check that 12 and 43 reference posts with post_type set to attachment.

    BTW: Here is a link to the plugin’s page on my site. I made a few updates to it after I created the post above.

    Bet it doesn’t eliminate the styles it just throws in the middle of your nice clean xhtml though right?

    minute44,

    Not quite sure what you mean?

    the gallery shortcode function inserts a gallery into the post… but rather than giving you the option to use your own style sheet to tell it how to look, it bungs it’s own styles in…. right in the middle of your XHTML, making it no longer validate.

    minute44,
    I never even noticed that – Good catch. I’ll see what I can come up with.

    I hope it gets fixed because it’s the only thing stopping me using what is actually a cracking feature!

    2 mfields:

    I have inserted the ID’s of the post with the gallery tag in it. So I have create a page and put this in it:
    [gallery ids="863,1136,944,1374,1389,827,887,774,1352,1124,1175,565"]

    Is this what you mean??

    minute44,
    Hi, I have uploaded a new version (v0.1.1) of the plugin which will (should) produce valid xhtml.

    BioTecK,
    Maybe…. just so long as the ids are valid ID’s of attachments and NOT posts that contain attachments.

    so that will stop [gallery] from putting any style information in the HTML will it?

    Sure will, It will also provide an alt tag to images and remove the mysterious </p> that appears at the end of the [gallery] structure. Also, all of the other attributes supported by the gallery tag should work, along with the ‘ids’ that I added.

    Sounds promising mate.

    I’ll check it out tomorrow when i have more time on my hands.

    If it does what you say, I owe you a beer.

    Right on.
    Good luck with it!

    Aaa.. I see! But where can I find the ID’s of attachments? 🙂

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘wordpress 2.5 gallery from other posts’ is closed to new replies.