Was the classic gallery in the form of a [gallery] shortcode? After converting to block, switch to code view (3 dot menu at upper right). What appears in place of the gallery? It should be a HTML comment containing “wp:gallery” followed by a ul/li structure with img tags. The src attribute URLs within the img tags should take you the proper image file.
The page you linked seems to be a valid gallery, if brief. Were there other images in there?
Perhaps beside the point, but you don’t have to convert to blocks if it’s causing a problem. No excuse for things not working, but it could be an option.
Thread Starter
dimjon
(@dimjon)
Hi @bcworkz, thank you for your answer.
The link I attached in the previous post was the original gallery that was not yet converted. After conversion, a previous gallery post looks like this:
http://bernfred.dimjon.de/?p=8
The HTML code view is:
<ul class=”wp-block-gallery columns-3 is-cropped”>
but it’s empty, with no reference to the original images.
I’m really puzzled by this, as the gallery is recognized correctly before the conversion to blocks. The original HTML before conversion is:
<div class=”gallery gallery-columns-3″>
Yes, not converting to blocks is of course an option, I still would like to do it if somehow possible, in order to use more advanced gallery blocks afterwords.
Thank you very much for your help and further ideas,
Michael.
I’m not able to replicate the behavior you describe. Please post the original gallery shortcode you are using so I can match your situation as closely as possible in my tests.
Of course your attachment IDs will not be valid elsewhere, but I think I can work around that.
Thread Starter
dimjon
(@dimjon)
Hi @bcworkz – The only shortcode I see in the HTML view of the classic gallery is
<p>[gallery]</p>
without any IDs. Maybe that’s the problem? That’s the output of the tumblr converter.
After the conversion, the HTML is:
<ul class=”wp-block-gallery columns-3 is-cropped”>
Also, without any IDs.
In the meantime, I duplicated the gallery before converting it to a block, so the converted (empty) Block Gallery and the original Classic Gallery are combined in one post. But that’s probably not really helpful?
It’s here: http://bernfred.dimjon.de/?p=17
Thanks a lot for your efforts, Michael
The plain vanilla [gallery] was it! Mine had the ids=”123,345,456″ bit added in because I used images already attached elsewhere. Upon even further investigation, even my version of gallery isn’t ideal after conversion. There’s no choice of thumbnail size and you cannot link to attachment pages. Sadly, it’s safe to say the classic gallery to block conversion isn’t fully developed yet.
I’m afraid your only choices are to either recreate your galleries anew using the gallery block, or use a classic block and insert the original [gallery] shortcode. You can then edit the gallery the old way through the pencil icon. Do not use the shortcode block or you will not be able to edit the gallery. I’m not thrilled with the new gallery block, so you can easily guess what I would do in your place.
Seeing the number of gallery posts you are faced with, a script that automates the process would be incredibly useful. I’m not aware of such an animal, but it would be worth doing some searching. If you have any PHP skills, you could develop your own. Or maybe consider hiring someone to build one. To be clear, I’m not offering any services here, that would be against our guidelines here. Soliciting paid help here is also, but you could find professional help at jobs.wordpress.net/ or jetpack.pro/