235 responses to “Cleaner WordPress Gallery Plugin”

  1. Ian Stewart

    Very cool idea, not only cleaning up the gallery, but also preparing the links for Lightbox & friends. Smart thinking.

    And surprising that given the concern for standards the gallery code isn’t XHTML strict. Weird.

    plus, glad you like Theseus (and thankful it didn’t break in your test)! And Peaceful Rush is still one of the nicer WordPress themes.

  2. Matt

    For those following along at home, the XHTML for the gallery should be completely valid for the next release. It just slipped through our testing the first time around.

  3. J Mehmett

    Hi Justin,

    Thanx for your release, I downloaded it and tested it in my localhost, and everything looks great. I’m going to upload it on to my blog soon.

    I’m using “Options” theme in my local test server and it’s compatible, man. I’m very happy with this…

    Thank you anyway

  4. BoltClock

    I’m not gonna use the gallery feature yet, but I was taken slightly aback by the fact that the shortcode outputs invalid XHTML. It’ll probably be fixed in WordPress 2.5.1 or something, but then again, as you said your plugin does have some other nifty features :)

  5. Brandi Boyd

    Quick question..say the gallery feature ends up with valid code soon and for simplicity’s sake I want to go back to using it when that happens… Will disabling the plugin later make it necessary to re-create existing galleries, or will they work with the standard gallery feature post-plugin?

    Thanks for the hard work and valid code.

  6. WordPress Modder

    Great solution, and nice to hear from Matt that the invalid code was just an oversight.

  7. mccormicky

    By the time I’ve recovered from upgrading 13 other websites plus my own and hunting down/testing out replacement plugins for plugins that bit the dust upon the release of 2.5 maybe 2.6 will be out.

  8. Dade Williams

    it would be cool if you could place say a banner on your post and that said banner will be shown on each photo page but not the same banner every time a gallery is posted

  9. Kay Kastum

    Yeah. The new WP really is not helping much. It creates more problem than making things easier as what I have experienced…geez. I’ll try this one soon.

  10. justin

    Thanks this is great, exactly what I was looking for!

  11. Ultime dal fronte WordPress 16-2008: Sicurezza ed altro

    [...] punto di vista del codice generato, dato che non è valido XHTML. Per cui, provate questo plugin Cleaner WordPress Gallery, che integra anche qualche interessante abbellimento JavaScript come [...]

  12. bearacid

    When i was reading your article, it was really awesome because it feeds my knowledge and it was so entertaining, by the way. hope you can make more article just like this. it helps me a lot. thanks and good luck. :)

  13. olovito

    Excellent work Justin, as always.
    I modified one thing: in order to limit each gallery to show only the specific pics uploaded for that post I changed the $a_rel to ‘lightbox[gallery-' . $post->ID . ']‘. Otherwise Slimbox shows all uploaded gallery pics in every post that uses the gallery.

  14. Mimos blogg

    [...] gallerifunktionen i Wordpress, för nu har Justin fixat ett plugin för att rätta till alla fel: Cleaner WordPress Gallery Plugin. Insticket gör att sidan validerar, att det skapas alt-taggar på miniatyrerna samt att man [...]

  15. theWizard

    awesome plugin man, thanks alot. this is a lifesaver!

  16. Brad Mahaffey

    Great plugin, thanks so much!

  17. WordPress Wednesday News: WordCamps Everywhere, Webware 100 Again, Plugins to Fix WordPress 2.5, Change Admin Colors, and More : The Blog Herald

    [...] Alternatives to the Built-in Gallery: Cleaner WordPress Gallery Plugin acts as a replacement with the default gallery feature of WordPress 2.5, and solves a lot of [...]

  18. Reading Circle Books » » WordPress 2.5 Widgets — Taking the Load Off Your Mind

    [...] for more than this summary. [↩]And thanks to Justin Tadlock the widget master for the shiny new Cleaner Gallery plugin! [↩]While I was drafting this, an even more exasperated comparison was posted by Huug and [...]

  19. Hetal Bhagat

    This plugin rocks!!! I was looking for something like this for the gallery. Tried it out on my localhost and would be uploading it soon to my blog. Thanks Justin.

  20. Doug

    I honestly did not know Wordpress had a gallery. Where’s the gallery? Also, is it possible to make this plugin turn all pictures in post to lightbox by default with captions.

  21. Dennis

    Hi,

    I took your plugin as a base for mine. I added greybox, thickbox (the one standard in wp) and highslide support. And I use the exif info that wp 2.5 now stores in the metadata to ad to the boxes. Als I extract gps info and you can view the location of the pictures taken in a box to.

    You can see it live here: http://kruyt.org

  22. WordPress Weekly News, 16-2008: security and much more

    [...] not-so well working, because it outputs broken XHTML code (not validated). Here’s the plugin Cleaner WordPress Gallery, that does well the job and adds some nice JavaScript like [...]

  23. Dennis

    Hi Justin,

    What I mean with thickbox, is I auto load it in the plugin. no need to embed in my theme. And thickbox is already by default in WP2.5

    code for using the tb in wp:

    wp_enqueue_script('thickbox');
    add_action('wp_head', 'thickbox_css');
    
    function thickbox_css() {
    
        $thickbox_csspath = get_bloginfo('wpurl')."/wp-includes/js/thickbox/thickbox.css";
        $thickboxscript = "\n";
        print($thickboxscript);
    }
    

    And here some code I use to put the exif info that wp 2.5 now reads from files in the title, so the ‘boxes’ can use it to. To display exif.

    // Get EXIF from WP and set in title
    $metadata = wp_get_attachment_metadata($id);
    $image_meta = $metadata[image_meta];
    
    //print_r ($metadata);
    
    if($image_meta[camera]) $title = ''.$image_meta[camera].' ';
    if($image_meta[focal_length]) $title .= '@ '.$image_meta[focal_length].' mm ';
    if($image_meta[shutter_speed]) $title .= '- ¹/'.(1/($image_meta[shutter_speed])).' sec';
    if($image_meta[aperture]) $title .= ', ƒ/'.$image_meta[aperture].'';
    if($image_meta[iso]) $title .= ', ISO '.$image_meta[iso].'';
    if($image_meta[created_timestamp]) $title .= ' on '.date('j F, Y',$image_meta[created_timestamp]).'';
    
  24. Matrich

    Thanks so much for the plugin. I was so anxious about the Gallery feature in WP 2.5 however I was shocked when I saw the inline css in the page and it was breaking. I wondered what had happened because ever since I started developing using css, i hadn’t come across css code in the middle of a page.

    Anyway, it was great to hear from Matt that it was just an oversight but it will be out very soon with the next release. That will be so fantastic.

    Otherwise, I really like the gallery feature and most of the other features in WP 2.5.

  25. Andrew Mee

    Great work – the first plugin I’ve found which deals with the wp2.5 gallery the way I wanted to (by turfing it out entirely, and doing it better!) Seriously, excellent work!

    The only addition I made to this was adding the lines;

    $myCaption = ($attachment->post_excerpt == "") ? $attachment->post_content: $attachment->post_excerpt;
    if ($myCaption == ""){ $myCaption = $attachment->post_title; }

    That way it looks for the caption in first the caption, then the description field, and if it can’t find it in either, it uses the title. Not appropriate for everyone I’m sure, but for my usage I always want a caption and Picasa captions come out in description, not caption annoyingly enough.

  26. Mimos blogg

    [...] över att dom inte tagit tag i valideringsfelen från mediagalleriet bland buggfixarna. Så Justins Cleaner WordPress Gallery plugin fick slås på igen. Nu har jag upptäckt att andra små förargliga valideringsfel uppstår [...]

  27. twelvesixteen.net » Wordpress 2.5.1 and Lightview Awesomeness

    [...] other cool feature that l installed was the Cleaner Wordpress Gallery Plugin. This thing is a beauty. Using the native wordpress admin interface, starting at version 2.5, [...]

  28. Perze Ababa

    Hi Justin. Thanks for creating this awesome plugin. Keep up the good work.

    BTW, here’s the lightview user defined variables that I used.

    $a_rel = "gallery[cleaner-gallery-$post->ID]";
    $a_class = "lightview";
  29. Matrich

    Hi Justin,
    Yeah, I downloaded WP 2.5.1 to see if it was sorted out about the inline css but unfortunately, it is still there so I am using your wonderful plugin however I am sure it will be sorted out.

    But atleast we are sure it will be sorted out sooner than later.

  30. Shane

    I’ve got the plugin installed and activated, but the gallery isn’t showing up. I’m using the “Insert gallery into post” and it outputs the [gallery] tag. Am I doing something wrong?

  31. Weblog Tools Collection » Blog Archive » WordPress Plugin releases for 4/28

    [...] Thanks for visiting! If you’re new here, you may want to subscribe to our RSS feed. This blog posts regular Wordpress news, updates of themes, plugins, ideas, hacks, quick fixes and everything about blogging, especially about Wordpress. Go ahead, subscribe to our feed! You can also receive updates from this blog via email.Clean WordPress Gallery Plugin [...]

  32. WordPress Image Gallery Test | Quantum Xen

    [...] added the Cleaner WordPress Gallery Plugin and trying it out on the [...]

  33. Bertilo Wennergren

    It seems that this plugin uses “dl” lists (definition lists) with “dt” elements (”definition term”), just like the default WP gallery code.

    I’ve read lots of criticism of the galler code, but as yet I haven’t seen anyone question the element choice. In what way is a gallery of images a definition list? In what way is an image in such a galler a definition term? And where are the definitions (the “dd” elements)?

    If were going for valid XHTML, shouldn’t we try to use elements according to their definitions too? Validators don’t catch such errros, but they are just as important as validation errors, perhaps even more important.

    “dl” lists are often (mis)used to get the typical layout that such lists usually get in browsers, but as far as I can tell, that’s not the reason for the choice of “dl” here. The CSS seems to override the typical “dl” presentation completely. So I’m really baffled? Why “dl”?? I must be missing something…

  34. Charles

    This is an awesome plugin. Thank you very much.

    Sorry to hijack this thread but…:
    @Dennis – I just checked your blog. I really like what you did with your lightbox images. I see the code you posted for the EXIF information. Which files do you insert that into? Thanks!

  35. Bertilo Wennergren

    Justin:

    If you don’t like the element choice, you can always change it with your gallery shortcode.

    Yes, but 99.99% of all users won’t. And then we’ll have heaps of “dl” elements that are not definition lists at all. There goes our semantic web… The default choice should be a good one.

    Granted, we should probably use different elements, but what should those elements be? I don’t see any clearly logical elements for displaying galleries..

    If there is no element in XHTML with a meaning that fits, then we should use “div” and “span”. That’s what they are there for. XHTML is not a particularily rich markup language. But it doesn’t get any better if we misuse the XHTML elements that do have a clear meaning.

    Maybe the use of a definition list is perfect for this situation. The gallery (dl) has images (dt) and captions (dd). A list with terms and descriptions. Of course, this is using the word “term” a little looser than usual, but do terms have to be text? If we answer yes, then the markup is most definitely wrong. If we say no, then maybe it’s a good solution.

    I think a “dt” needs to be a term. That might be a symbol, and an image could be a symbol. In any case the corresponding “dd” element should be a definition of that term/symbol. A caption could perhaps be a definition of its image, sometimes, but not very often. I doubt very much that many actual galleries are of that kind. And a gallery without captions? Could that in any conceivable way be seen as a definition list? A definition list without definitions? I really don’t think that makes any sense.

    In my opinion the default should be changed to “div” instead of “dl”.

  36. WordPress 插件推荐(20080428) | 长风破浪会有时

    [...] Clean WordPress Gallery Plugin [...]

  37. tartan - webdesign

    hi there, good job, I started to use this plugin and it gives a lot, and of course it’s better that the standard gallery, also – because it creates valid code – I don’t know how other people but in my mind that always stands for quality.

    best regards from scotland

    a.d.

  38. Diseño Web

    At the moment everything looks great, I keep testing on diverse browsers.

  39. Grant Palin

    @Denis

    Curious about your meta code…did you add that to the plugin? I see the end result on your website, and would like to do something similar. Any suggestions?

  40. steffy

    this plug in rock, thank you VERY much, it helps me a lot
    thanx again

  41. Bertilo Wennergren

    Justin Tadlock wrote:

    The word “definition” isn’t always accurate, even when talking about a definition list. W3 (article above) calls this both a definition and a “description.” Now, an image caption may not always be a definition, but it should always be a description. Otherwise, it’s not a caption at all. Of course, I’m being a bit picky with words.

    Maybe not too picky. That could be a way to justify the use of “dl” in the gallery code. But I’m a bit afraid that we’re getting close to redefining “dl”, “dt” and “dd” as “list (dl) of items (dt) with related text(s) (dd)”. That seems a bit too “unsemantic” too me, but I could be wrong.

    Would it then be OK to use “dl” with a single element as a general way of marking up images with captions? It’s not illogical for a list to have just one element, I guess… Actually I’ve long felt that XHTML lacks a good way to add a caption to an image. Could “dl”, “dd” and “dt” be it?

    But then again: If there are no captions (i.e. no descriptions), just a bunch of images (I think that will very often be the case), then it’s hard to justify the use of “dl”. But the gallery code uses “dl” for such galleries too…

  42. » Gallerie di immagini: Cleaner WordPress Gallery Plugin » Blogg ‘R

    [...] → cleaner-wordpress-gallery-plugin Stampa  (Nessun Voto)  Loading … Tags: gallery, plugin, Wordpress & C., wordpress [...]

  43. Plugin per Wordpress Rilasciati Recentemente | Problogging

    [...] Clean WordPress Gallery Plugin [...]

  44. Kei

    im choosing the thickbox option.
    however, it seem to break the site

    before applying the plugin
    http://img113.imageshack.us/img113/2561/15920743ac6.png

    after applying the plugin
    http://img113.imageshack.us/img113/5743/49590464ct0.png

    could you please help me check it out?

  45. dieKretzschmars.de » Wordpress 2.5 Gallerien mit Dkret3 1.9

    [...] meiner Seite setze ich zusätzlich das Plugin Cleaner Gallery ein. Das Plugin behebt ein paar Fehler der derzeitigen Gallerie-Funktion von Wordpress und bietet [...]

  46. Zodomatica - Bits of Tzaddi's Life

    [...] this post has me a bit disappointed with the integrated gallery feature in WP2.5. I downloaded a cleaner gallery plugin which is a start, but still. There doesn’t seem to be a way to do the things I wanted to do [...]

  47. erwan

    ho great!

    thx a lot justin, that’s really the best photo plugin for WP!

    your plugin cleaned up my gallery just installing it, and I got exactly what I want: a valid xhtml gallery with lightbox!

  48. mxxx

    nice plugin mate, works very well.

  49. MightyFunk » Blog Archive » Setting up and Installing Wordpress

    [...] Cleaner Gallery – Fixes WP’s default gallery and provides valid XHTML code instead. [...]

  50. henri

    Hi Justin,

    Nice plugin you made, I have a trivial question about the wp_postmeta table :

    I want to upgrade my previous thumbnails format to the 2.5.1 format but when I replace “thumb” by “thumbnail” and the file extension .tumbnail.jpg by the -150×150.jpg but it didn’t work, maybe you have an idea ;)

    Thanks a lot
    henri

  51. 让WordPress原生相册支持lightbox效果 | Smartr.cn

    [...] Lightbox的Ajax照片显示效果对访客来说是很有吸引力的。但对于WordPress插入整个相册的功能,我们怎样让它们都支持lightbox的便捷浏览效果呢?这里介绍的就是一个增加WordPress原生相册lightbox效果的插件:Cleaner WordPress Gallery Plugin。 [...]

  52. philsblogging

    Thank you. The gallery wordpress comes with is quite unsatisfactory if you just want to customize it a bit. I am just afraid that further updates of Wordpress will allow customization sooner or later. Because the way it is now, just doesn’t live up to most expectations!