Hello, I noticed that since I switched to TT3 all images that were centered before are now aligned to the left. Seems like the alignment is now just ignored by the system. What can I do to revert this? Thanks.
Thank you for the additional details, @immaterial. I think I might have found what’s causing this. Where you by any chance using the Classic Editor when you wrote these posts in TT?.
I found that when you insert an image in TT using the Classic Editor, the image will appearto be centred but if you check, you will notice it set as “No alignment”. As it turns out (and this is arguably a bug) TT displays “no aligment” images as centred.
When you publish this (still using TT), it will appear as centred in the frontend too:
The problem is that the image is not really centred, and when you switch themes, TT3 will align “No alignment” images to one side.
To fix this, you can add the following custom CSS code:
.single .entry-content > p > img.alignnone,
.page .entry-content > p > img.alignnone {
margin-left:auto;
margin-right:auto;
display:block;
}
The code above will center “No alignment” images inside your posts and pages. Please bear in mind that if you switch themes, you might run into this same issue again, so make sure you save this code somewhere for future reference.
This reply was modified 1 year, 3 months ago by Alvaro Gómez.
I am glad you figured it out, and thank you for sharing your solution @immaterial. After some digging, I found a Trac issue and a GH issue where this is being discussed so, hopefully, it should be fixed soon. Thanks again!
Viewing 5 replies - 1 through 5 (of 5 total)
The topic ‘Images not centered’ is closed to new replies.