Yes, I’m referring to posts (on Blog Home and Single post pages).
In my previous theme (TT) it works, when reactivated in Live preview.
I’m using WP 6.3 with Gutenberg plugin 16.5.0.
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 appear to 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.
Hi, thanks to you I now found the solution. The CSS-code you gave me didn’t solve the problem however.
I am indeed using the Classic editor, but the images contain this, as an example:
<img class="size-full wp-image-1111 aligncenter" etc.
So now I modified your CSS in this way:
img.aligncenter {
margin-left:auto;
margin-right:auto;
display:block;
}…and it worked. How come “aligncenter” doesn’t work automatically?
