Support » Fixing WordPress » Updating Galleries

  • A number of galleries created with classic wordpress are formatting incorrectly since the wordpress update to blocks. There are years of posts affected.

    1. Is there a way to convert all classic galleries to blocks without losing content, en masse? The site is several years old and it would be a pain to convert each post individually– it also seems like converting individual galleries to blocks within a classic post deletes their content.

    2. Is there a plugin that updates existing galleries en masse? I’d like to eliminate the white border and introduce other formatting, but most advanced plugins require that you build separate galleries and then insert them into posts via their platform. I just want something that will adjust the existing content– again, there are years of galleries here.

    3. Open to CSS solutions for this as well, but I’ve just adjusted a bunch of PHP errors and am worried about breaking the site. I also need a solution that will survive future WordPress updates.

    Thanks for reading!

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Joy

    (@joyously)

    classic wordpress are formatting incorrectly since the wordpress update to blocks. There are years of posts affected.

    This is confusing. The old posts are unaffected by the blocks or block styles unless you edit the post with the block editor. Your theme might have changed, but the editor did not affect the old posts.

    1. The classic gallery shortcode uses the attached images by default, so if there are no IDs specified, it will show all attached images. If you specified image IDs, only those images are shown whether they are attached to the post or not.
    The gallery block puts the image markup into the post.
    There might be a plugin that would invoke the gallery shortcode to get the image HTML and replace the shortcode with it.

    2. The white border is just CSS. No need to do anything to the posts themselves. Look to your theme for gallery styling.

    3. The styling is all CSS, no PHP. There are many plugins that allow you to render the gallery shortcode differently than core does. Which is more future proof: a bunch of posts with a shortcode whose code you can affect in one place, or a bunch of posts with image HTML that you would have to edit individually to change?

    Sorry for any confusion! My theme did not change, but the gallery styling and formatting definitely did with wordpress updates, I don’t know what to tell you. Galleries did not split before, wordpress updated, and now they do. Given your comments, It may have to do with my theme’s relationship to the wordpress updates.

    1. Thanks for this input
    2. Thanks for this input
    3. I think this language of “gallery shortcode” is what I needed for my plugin search: my current searches were just turning up expanded gallery plugins.

    Appreciate your help!

    So, I’ve installed “Meow Gallery,” which does the job of editing existing galleries . . . except for posts created before 2014. For those posts, the words “Meow Gallery: the Gallery is empty” appear in the post itself. But when I go to edit the post, the photos are right there, in the classic gallery editor.

    Again, I’m pretty sure this has to do with a wordpress update and its relationship to my theme– but any language that would help me troubleshoot would be useful– I was excited to find a plugin that at least partially worked, but I’m trying to avoid testing All the Plugins. Given these parameters, am I looking for more specific attributes to a plugin, or to I just need to suck it up and rebuild the oldest galleries?

    Thanks again.

    Joy

    (@joyously)

    I’m not aware of any changes to the gallery shortcode except that the IDs parameter was added (could have been around 2014, don’t know).
    Perhaps you should ask the plugin author what the difference is for older galleries.

    The theme is not supposed to style galleries any differently, unless they are set to be the gallery post format. A lot of themes do it without that though. Post formats are theme specific.

    I think it’s exactly the IDs parameter that is causing the change, that seems to be the big difference in the code. It could be that the plugin is reliant on that parameter.

    I don’t mind going back in and assigning IDs at this point, since the plugin eliminates more than half the posts I would have to edit– but is there an efficient way for me to find the gallery ID for images that are already loaded into a post, but have not been assigned a number in the code?

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