• ImageKurtM

    (@ann47he1rpjggx6f3yso)


    I have converted images in all of my posts to HTML format instead of block format to be able to insert a CSS class for more spacing between the images and text and doing so has always worked. After upgrading to WordPress 6.9 however, the image alignment aligncenter does not work for the images. The images are aligned on the left. Converting an image back to block format results in image alignment aligncenter working. However, then the image spacing CSS class is removed after converting the image HTML code back to block format. The issue wasn’t resolved by logging out and then logging back in to my Administrator dashboard.

    • This topic was modified 1 day, 13 hours ago by ImageKurtM.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Imagethreadi

    (@threadi)

    Unfortunately, I don’t understand how you converted images into HTML code. To understand your request, would it be possible to provide a link to the website in question?

    @threadi I’m assuming they meant the Edit as HTML option that allows one to convert blocks to be edited as HTML. Now using the <img src.. instead of the Media block.

    @ann47he1rpjggx6f3yso It would be helpful to provide a link to the page where this is happening so we can help check if there are any CSS overrides going on, as @threadi requested. If you’d like to immediately downgrade to fix this issue and troubleshoot later or on a test site perhaps, here’s a helpful guide to downgrading WordPress: https://kinsta.com/blog/downgrade-wordpress/ or https://www.hostinger.com/in/tutorials/downgrade-wordpress.

    Thread Starter ImageKurtM

    (@ann47he1rpjggx6f3yso)

    Victor’s response is correct. When I edit the inserted image as HTML, add the custom CSS class, and then click over into an empty area of the post, I get an error and the option to convert to HTML format or back to block format. To maintain the custom CSS class I add, I select the option to convert the image code to HTML format.

    Unfortunately, I can’t provide a link because the issue is with my sandbox site, which is not open to the public for obvious reasons. I have not updated WordPress on my live site due to the image alignment issue. Following is an example of the code I usually use when inserting images on my site:

    <figure class="wp-block-image aligncenter size-large"><img class="image-margin-default" src="https://www.xyz.net/wp-content/uploads/images/posts/2025/xyz_2025-008-01_faucet--water--supply--connection--original--installation_640x480.jpg" alt=""/></figure>
    • This reply was modified 1 day, 8 hours ago by ImageKurtM.
    • This reply was modified 1 day, 7 hours ago by ImageKurtM.
    Moderator Imagethreadi

    (@threadi)

    Unfortunately, I still don’t quite understand. How do you insert the HTML code? Do you use the HTML block (which is intended for this purpose) or do you switch to the code editor view? What exactly is the error message you are getting? Feel free to show screenshots of what you see: https://wordpress.org/support/forum-user-guide/block-editor/#adding-screenshots

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.