Home Forums Add-ons Gallery Field Can't Reorder Images in Gallery


Can't Reorder Images in Gallery

  • I currently have a site setup on a multisite install using ACF and the Gallery Add-on. I am unable to drag the images in grid mode to reorder them. I have the most recent versions of both plugins running on WP 3.6.1.

    I’ve used the Gallery Add-on before and not run into any issues in the past. The plugins are only activated on the subsite, not network activated. I don’t see any js errors in Chrome Developer Console.

    Otherwise it works as it is supposed to. Any ideas?


  • Hi @ellenm1206

    Can you please try this in firefox and check the firebug console log for any errors on page load or when you drag an image.

    Next, check if the gallery field .js file is being included correctly on the page and that the sortable .js file is included in the wp-load-scripts file.


  • Hi Elliot,

    I think I found the culprit. In Firefox I get the following:


    So, I disabled all plugins and changed the theme to Twenty Twelve. Still same issue. So I did a Google Search on the message and it led me back to your forum, here .

    Then, I went and looked at my Location Rules.

    Location Rules

    When I changed the second rule to a different Logged In User Type so that it didn’t apply to the user anymore, then the sorting of images in gallery field work. Once I set it back to the logged in user type for that post I get the above message in Firefox console.

    Does that help?

  • Hi @ellenm1206

    Just to clarify, when you change the field group location rules so that the field group does NOT show on the page, the gallery field works correctly?

    If this is so, perhaps you have a PHP error on the page (from this field group) that is causing the issue in the gallery field.

    Please check your source code for any errors and check your console log for any JS errors – not just AJAX calls.


  • Hi Elliot,

    Actually, the gallery field will show and work on the post with the top location rule and work fine. Once I add that second rule in for the Logged in User Type then I can longer drag the images to sort when I add a new post.

    Here is a screencast showing it not working and working: ACF Gallery Sorting

    Just a note on the video — the user is a Contributor but does the same for any other role too, i.e. Author. And, as Admin if I go in to the post that field is still locked by WordPress.

    Also, when I turn on WP-DEBUG I only get notices. Here is a screenshot of those.

  • Hi @ellenm1206
    I still believe there is a JS error on the page, your screencast shows that you opened the console log after adding the images.

    What you need to do is open the console log from the very start of the page – before the page has loaded.

    Can you try this and report any JS errors?

  • Hi Elliot,

    I had the console open from when I add new post and there are no errors whatsoever.

    Here is the Screencast.

    I even changed the user to Author to make sure it wasn’t a problem with Contributor not having publishing rights. And, now I just have the one rule.

    I tested it on another subsite of the multisite and same problem. But on a local install it works fine 🙁 I may setup a multisite locally to see if I can create the error. I think it comes back to WordPress post lock message from my first post in the thread.

    Let me know if you have any more ideas and I’ll let you know how it goes on my local multisite install.


  • Hi @ellenm1206

    Thanks for the screencast. Are you able to check the source of the post-new.php page for the sortable .js file.

    Perhaps you have another plugin / theme code which is preventing this file from loading?

    Does any other drag / drop functionality work on the edit page? Can you try adding a relationship field to the page and selecting / re-ordering some items?


  • Hi Elliot,

    The only sortable in the post-new.php file is in this script line
    <script type='text/javascript' src=',jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,underscore,backbone,wp-util,&load%5B%5D=wp-backbone,media-models,plupload,plupload-html5,plupload-flash,plupload-silverlight,plupload-html4,json2,wp-plupload,media-view&load%5B%5D=s,quicktags&ver=3.6.1'></script>

    jquery-ui-sortable is there but I don’t know if that is what you are looking for.

    Also, I added a relationship field and the sorting doesn’t work. I also took off the content editor so it wouldn’t display incase it was a plugin adding a button to the visual editor but that didn’t make a difference.

    I’ve disabled all the plugins and changed theme to default Twenty Twelve but still had the issue. That ruled out functions I have in my child theme.

    It’s the Logged in User in the location rules that is causing the issue. When I don’t have that rule it works. It’s baffling but has to be something I am doing. Ugh.

    I’m going to try and work this the other way. I’m going to build the site up from a clean single install and see if I still have the problem.

    I’ll let you know if it works.


  • Hi @ellenm1206

    Thanks for the detailed info. I’ll do some testing and get back to you


  • I’m having this same exact issue on a site. Can’t re-order images. I cannot replicate the “fix” above by implementing user permissions. I just can’t re-order images in the gallery. I can, however, reorder other items on the admin page, so the sortable script is functioning properly.

    Any solution to this yet?

  • I now see this issue in 2 of our sites. On site A, we can re-order images until we publish, then we cannot any longer. On site B, we cannot re-order images at any time. Is anyone available to help troubleshoot this issue?

  • Hi @lionheart

    Just to clarify, you are also experiencing the sortable function not working when using a location rule of ‘Logged in User’?


  • No.. I have no location rules. I tried Ellen’s rules to see if I could get any resolution but it made no difference. Can’t sort, period.

  • Hi @lionheart

    If you can’t do any sorting, please first check your console log for any JS error on page load. If you find any, please start a new topic with all the data.

    Next, check the page source to see if the sortable JS is being included.


  • Did the above already. There is one error that is present on the front and admin panel: Error is

    [Error] TypeError: ‘undefined’ is not an object (evaluating ‘playerDiv.addEventListener’)
    global code (main.js, line 86)

    However, this error is present on our sites where we can re-order images, plus, you can see this exact error at too, so that’s not likely the issue.

    SortableJS is being loaded, and we can re-arrange boxes in the admin. Just not the gallery images. Happy to give you an admin login so you can see the issue for yourself if you want to email me.

    Thanks for your help!

  • Hi @lionheart

    A login would be great + instructions to find the field and replicate the issue.


  • This reply has been marked as private.
  • FYI I did some testing and it seems it’s the same problem as here:

    i.e. the Gallery field thumbnails are only draggable if the acf_form displaying the field group containing the gallery field is the first acf_form on the page.

  • Having the same problem, Any ideas?

  • I just updated and having the same problem as well!

  • For what it’s worth, a customer just reported they can no longer order images properly. They are able to sort them in the backend, hit Update and the order is gone again. Also, all galleries on the frontend are in the wrong order. I am very familiar with the Console, and there is not a single error, and no rules relating to users being logged in or something.

  • In my case, it actually was real easy. Another plugin responsible for drag’n drop re-ordering of posts and CPT items interfered with ACF. Once I disabled it, ACF worked flawlessly and as before. Just for those who have problems with re-ordering not being saved in the backend may just look out for some faulty plugin.

Viewing 24 posts - 1 through 24 (of 24 total)

The topic ‘Can't Reorder Images in Gallery’ is closed to new replies.