Support » Plugin: Media Library Assistant » mla_gallery sort by upload-date acsending

  • Resolved photo159


    I’m trying to sort the pictures in [mla_gallery] by upload-date having the oldest pics first, the newest last.
    I replaced the upload-date with the exif date and time stamp (worked fine according to the meta-data shown in the library). But the sorting just won’t work.

    I tried the following codes:

    [mla_gallery attachment_tag=xtest orderby=”upload_date” order=”ASC” mla_alt_shortcode=gallery]

    [mla_gallery attachment_tag=xtest orderby=”upload_date” mla_alt_shortcode=gallery]

    [mla_gallery attachment_tag=xtest orderby=”upload_date” order=”DESC” mla_alt_shortcode=gallery]

    As far as I understood the first two should give me the result I’m looking for.
    The third one should give the newest pics first.
    In fact all variants show the same result, the newest first.

    Skipping the [mla_alt_shortcode] doesn’t make any difference.
    Skipping the [orderby] does obviously sort by the imageID, and the ASC/DESC works fine then.

    What am I doing wrong by using the upload-date?

    Thanks in advance for any ideas.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author David Lingren


    Thanks for your question and for all the details you’ve provided. Thanks as well for all the variations you’ve tried.

    You wrote “I replaced the upload-date with the exif date and time stamp“. I understand that to mean that you’ve replaced the date that WordPress displays as “Uploaded on:” in the upper right corner of the Media/Edit Media screen, the date that also appears as “Uploaded on” in MLA’s Media/Assistant Quick Edit area. Is that right?

    If so, the fix is simple. the [mla_gallery] shortcode’s orderby parameter uses a different name for this value, following the standard set by the WordPress [gallery] shortcode. You can find all of the valid orderby values in the “Order, Orderby” section of the Settings/Media Library Assistant Documentation tab. For your application, simply replace upload_date with date, e.g.:

    [mla_gallery attachment_tag=xtest orderby=date order=ASC mla_alt_shortcode=gallery]

    or just:

    [mla_gallery attachment_tag=xtest orderby=date]

    The first example will use the WordPress [gallery] shortcode to compose the gallery display, and the second will use MLA’s own code to compose the gallery. Many other plugins intercept the [gallery] shortcode, so pick the alternative that works for your application.

    I am marking this topic resolved, but please update it if you have problems or further questions regarding the above suggestions. Thanks for your interest in the plugin.

    Thank you for your quick reply and sorry for my late feedback. Could just today try again, and your suggestion works perfectly fine.
    Thanks again and even more Thanks for this plugin, which make makes it possible to handle lots of pictures in wordpress.

    Plugin Author David Lingren


    Thanks for your update with the good news and positive feedback. I’m happy to see that the suggestions were helpful.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.