• Resolved anilvanderzee

    (@anilvanderzee)


    Hi Ben,

    So you gave me a new code so the images would be centre on the mobile view. I started writing a new blog. But on the new blog the images are not centre anymore. Both on 4.7.5 and 4.8.

    /* center images on mobile screens */
    @media screen and (max-width: 719px) {

    .post-content img {
    float: none;
    display: block;
    margin: 0 auto;
    }
    .post-content .widget_polylang img {
    display: inline-block;
    }
    }

    Anyways. The weird part is that the old blog the images are still centered. How is that possible??

    I didn’t publish the new blog. I just did it for a second to see if it made a difference but no. Please help…..Thank you.

    New Blog: https://anilvanderzee.com/?p=43543&preview=1&_ppp=6c1f8e56fb

    Old blog: https://anilvanderzee.com/undauer-eng/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Theme Author Ben Sibley

    (@bensibley)

    Hmm I can’t get a preview of the new blog (screenshot). I would remove the code and re-add it double-checking that it’s exactly the same as on the old site. If it still doesn’t work, do you have caching enabled on the site? The way the CSS is added, it’s possible the new site is loading a version of the page from before the CSS was added. You can empty your cache to fix this.

    Thread Starter anilvanderzee

    (@anilvanderzee)

    Hi Ben,

    I ended up making a new post and manually transferring the paragraphs and pictures 1 by 1 and that seemed to work. I have NO idea what it was.
    Anyways it is fixed for now but I will try to clear the cache next time but that would be odd right??

    Thanks for the quick reply though.

    Thread Starter anilvanderzee

    (@anilvanderzee)

    Hi Ben,

    The problem seems to happen when I add a caption to the image.Once i remove the image it goes back to the centre. Kind of pity cause I would love to add some captions here and there

    Theme Author Ben Sibley

    (@bensibley)

    Okay I see. That’s no problem then. You can try this CSS instead to keep images with and without captions centered at mobile widths:

    /* center images on mobile screens */
    @media screen and (max-width: 719px) {
    
      .post-content img,
      .wp-caption {
        float: none;
        display: block;
        margin: 0 auto;
      }
      .post-content .widget_polylang img {
        display: inline-block;
      }
    }
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘New post images not centre anymore’ is closed to new replies.