On my website, I recently got a quite strange problem. I used to upload images via the nextGen Plugin. But since with this plugin google doesn't seem to index my pictures, I wanted to switch back to the native gallery.

So, naturally, I started to recreate the galleries step by step. A week ago, this worked just fine. Today suddenly all the sorting settings are ignored. Sort by menu, sort by title etc. are not visible. I emptied my cache a few times, but the problem doens't seem to be cache related.

Any help would be nice. The website in question is http://www.dreadfactory.de


Plugins that may effect the images are: "Lightbox 2", "NextGEN Gallery". The cache plugin used is "W3 Total Cache". If I deactivate all of them, the error persists.

Apart from that, the only script I installed manually is "TJK_ToggleDL.js", to toggle list elements.

The rest of my plugins should not effect the gallery:

"Qtranslate", "Redirection", "Post Type order", "Wp-beautifier", "WP google+", "Ultimate Security Checker", "Google XML Sitemaps", "Exclude Pages from Navigation", "Contact Form 7", "Captcha", "Broken Link Checker", "Block Bad Queries", "Better WordPress Minify", "All in One SEO Pack

Update 2

The Shortcode is [gallery link="file" orderby="title"]

  • Are the sort options not visible in the UI or is WordPress ignoring the sort order you set?
    – mrwweb
    Commented May 15, 2012 at 17:33
  • Everything looks normal in the UI. It's ignoring the sort order I set. Commented May 15, 2012 at 17:40
  • Just to double-check, if you set the sort order to random and reload a few times, does the ordering change? Can you tell what IS the sort order?
    – mrwweb
    Commented May 15, 2012 at 17:50
  • I tried the random option but even with the option random, the order doesn't change. It's now set to order by title (increasing). The gallery is: dreadfactory.de/galerie/dreadlocks/anke-k Commented May 15, 2012 at 18:01
  • The fact that there's a lightbox script means you're not solely using the core [gallery] shortcode. What plugins are you using or did you do something custom?
    – mrwweb
    Commented May 15, 2012 at 18:05

2 Answers 2


The Problem was caused by the plugin "Post Types Order". It takes control over all post orders including the order within galleries. Since there does not seem to be an option to exclude galleries properly, you will have to deactivate the plugin to have control over the gallery order again.


To fix the problem in "Post Types Order" plugin:


//ignore attachments
if ($query->query_vars['post_type']=='attachment') {
    return $orderBy;

On top in CPTOrderPosts() function.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.