Photo gallery changes order or displays wrong images

  • Unknown's avatar

    Hi, I have a WP web site I’ve been using for several years. In one of the pages I have several photo galleries with a lot of images (more than 100 each). When I started these photo galleries it was easy to update and add new pictures, but it has now become impossible to edit them. Every time I try to edit one of these galleries, for example, to add new pictures, WP changes the order of the images, or displays the wrong pictures, to a point that I cannot edit these galleries any more. Is there a way I can edit these galleries without getting these problems? Thanks a lot.

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Hi there, can you give us a link to the page that is happening on?

  • Unknown's avatar
  • Hi there,

    Image galleries are not designed to be used with that many images. By having so many images in one gallery you’re causing the editor to have to load a ton of code in your browser each time you try to edit the gallery, and it sounds like either the editor or your browser is being confused by this process.

    The only way to stop this from happening is to use multiple, smaller galleries per page, and even split your galleries across more pages if possible.

    Edit that page and remove around half the images from the gallery. Then create a new gallery under the first one, adding the images you removed to that one instead. This will significantly reduce the amount of code that needs to be loaded per gallery, and should prevent the issues you’ve been seeing. On the page itself it should be hardly noticeable, given the type of gallery – thumbnail grid – that you are using.

  • Unknown's avatar

    Thanks a lot for your answer kokkieh. OK, I was thinking it could be a problem of the amount of images. But then I have another question: is there a more practical way to “split” this gallery in two? I know some html and I tried to do it by editing the code, just copying and pasting that code (to create two identical galleries), and then simply deleting half of the images in each one, but then again, by doing these, the copied gallery displayed completely wrong images, not even belonging to this page, but from a different page in my web site. It seems that the image indexes in the code [gallery ids="1507….] are not absolute ids representing each a unique image in my web site, but rather they seem to depend on where this code is placed. All I want is to split this gallery in two, but keep the same images and the same order. Is there a practical way to do it using the html code?

  • The IDs are absolute – they were assigned to the images in the site database when they were originally uploaded to the media library – and it should work to manually manipulate the shortcodes as you described, at least in theory.

    But it could be that the data is already messed up from the very large original gallery, so if manually splitting the shortcode doesn’t work, it might be better to just redo the galleries from scratch. That way you can be certain the correct galleries are showing the correct images.

  • Unknown's avatar

    Thanks a lot kokkieh. I followed your instructions and it’s working OK now. I have one additional question: where does WP store information such as the captions and other details of each image? and is there a way to edit that? That information doesn’t appear in the shortcodes.

  • The topic ‘Photo gallery changes order or displays wrong images’ is closed to new replies.