• Hi, after the update to WordPress 4.9, I found out that even though I have centered all my images while drafting, captioned images in the published posts are not centered while not-captioned images are centered, which really mess up the look of my posts.

    I’ve disabled all the plugins and test one by one and it’s not a result of a plugin error/clash of plugins.

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Are you positive this just happened after 4.9 update?

    I can see in the html source that the alignment problem is not tied to caption, but the class="aligncenter" code is missing from the image’s tag.

    Some images are bigger (wider) than content width and that’s why it appears to be centered even if it doesn’t have class="aligncenter" code in image’s html tag.

    To fix this, we have to go to each image and assign that aligncenter class via WordPress image management, or if you are comfortable writing code just go right in the code and add it (switch to Text mode editing, not the Visual one).

    Thread Starter Jasline

    (@shoheiyuna)

    Hi Paulwpxp!

    Thank you for your reply!

    I understand the class=aligncenter is missing from the image’s tag.

    In the past, after I had aligned my images to the center via Text editing mode, I will add captions via the Visual mode as I write my posts. The class=aligncenter for captioned images will be missing (somehow) from the image’s tag, but the image will still remain centered. In my Visual editing mode, the images still look centered to me, but the published post is not the case. This is what I’ve been doing for a long time and the missing tag did not affect the image’s alignment.

    I am pretty sure it happened after the 4.9 update because the update was done 8 hours ago and I did not add any new posts or make changes to the theme files.

    I’m not fond of changing to previous WordPress versions, but if there is no solution at the moment, I guess I’ll have to do it.

    Thank you for your help!

    Hi! Did you ever figure out a fix to this? This same thing happened to our site around the same time. Only captioned images were affected and it seemed to be around the 4.9 update.

    Thread Starter Jasline

    (@shoheiyuna)

    Hi, the only way to resolve this is to add class=aligncenter to the image tag. I noticed that previously even without this class=aligncenter in the image tag, as long as the image is wrapped with the caption tag that is aligned center, the image will automatically be centered. But with 4.9 it’s not the case.

    However, after adding class=aligncenter to the image tag, there will be a spacing between the image and the caption. It’s not the most ideal but I’m living with it for now until there is a new update.

    I’m using Brunch Pro theme by FeastDesignCo. I just sent in a support ticket, not sure if they can help. May I know what theme are you using?

    Thank you for responding. I’ll try that to see if it fixes the issue. Unfortunately, we have 700+ articles so a manual fix is tedious. Let’s hope a patch comes in at some point.

    Our theme is a custom one. Thank you for responding. Let me know if the support ticket helps you.

    Thread Starter Jasline

    (@shoheiyuna)

    Hello!

    My theme designer got back to me and the solution they proposed worked for me:

    Look in your style.css for this:

    img.centered, .aligncenter {
    display: block;
    margin: 0 auto 22px;

    Change it too:

    img.centered, .aligncenter, .aligncenter img {
    display: block;
    margin: 0 auto 22px;

    Hope this will work for you!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Captioned image not centered after update to WordPress 4.9’ is closed to new replies.